summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Christiaens2010-09-28 08:18:21 (EDT)
committer Knut Wannheden2011-04-28 05:18:04 (EDT)
commitc5b24f1a848343fd901074d4c69a40e3d3b49aea (patch)
tree4f431831adaa078156b952b75da744bea181ad75
parentaff47208f76b676588775cd50d6ae6a6ab36fd83 (diff)
downloadorg.eclipse.xtext-c5b24f1a848343fd901074d4c69a40e3d3b49aea.zip
org.eclipse.xtext-c5b24f1a848343fd901074d4c69a40e3d3b49aea.tar.gz
org.eclipse.xtext-c5b24f1a848343fd901074d4c69a40e3d3b49aea.tar.bz2
Refactored a bit.
-rw-r--r--plugins/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/FastDamagerRepairer.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/FastDamagerRepairer.java b/plugins/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/FastDamagerRepairer.java
index 6e2b63e..92b31f3 100644
--- a/plugins/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/FastDamagerRepairer.java
+++ b/plugins/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/FastDamagerRepairer.java
@@ -192,7 +192,10 @@ public class FastDamagerRepairer extends AbstractDamagerRepairer {
int regionOffset = tokenStartsAt;
int regionLength = e.fDocument.getLength() - tokenStartsAt;
int lengthDiff = e.fText.length() - e.fLength;
- tokenStartsAt += lengthDiff;
+ int afterRegion = e.fOffset + e.fText.length();
+
+ tokenStartsAt += lengthDiff;
+ nextTokenStartsAt += lengthDiff;
LinkedList<TokenInfo> tokenInfosCopy = new LinkedList<TokenInfo>(tokenInfos);
assert tokenInfosCopy.equals(tokenInfos);
@@ -216,7 +219,7 @@ public class FastDamagerRepairer extends AbstractDamagerRepairer {
assert tokenInfo == tokenInfoCopy;
- if (token.getStartIndex() >= e.fOffset + e.fText.length()) {
+ if (token.getStartIndex() >= afterRegion) {
if (tokenStartsAt == token.getStartIndex()
&& !tokenCorrespondsToTokenInfo(token, tokenInfo)) {
assert tokenInfosCopy.equals(tokenInfos);