SelectWordUtil cleanup (IDEA-CR-15854) appcode/171.1041 clion/171.1040
authorpeter <peter@jetbrains.com>
Thu, 17 Nov 2016 08:48:00 +0000 (09:48 +0100)
committerpeter <peter@jetbrains.com>
Thu, 17 Nov 2016 08:52:52 +0000 (09:52 +0100)
platform/lang-impl/src/com/intellij/codeInsight/editorActions/SelectWordUtil.java

index 9026286d2778f84a1c6119174190f0b7fa8682ef..0bef80ad6a72d0d686500adbd6a54632e9997e5f 100644 (file)
@@ -258,9 +258,8 @@ public class SelectWordUtil {
         availableSelectioners.add(selectioner);
       }
     }
         availableSelectioners.add(selectioner);
       }
     }
-    long stamp = editor.getDocument().getModificationStamp();
     for (ExtendWordSelectionHandler selectioner : availableSelectioners) {
     for (ExtendWordSelectionHandler selectioner : availableSelectioners) {
-      List<TextRange> ranges = askSelectioner(element, text, cursorOffset, editor, stamp, selectioner);
+      List<TextRange> ranges = askSelectioner(element, text, cursorOffset, editor, selectioner);
       if (ranges == null) continue;
 
       for (TextRange range : ranges) {
       if (ranges == null) continue;
 
       for (TextRange range : ranges) {
@@ -278,9 +277,9 @@ public class SelectWordUtil {
                                                 CharSequence text,
                                                 int cursorOffset,
                                                 Editor editor,
                                                 CharSequence text,
                                                 int cursorOffset,
                                                 Editor editor,
-                                                long stamp,
                                                 ExtendWordSelectionHandler selectioner) {
     try {
                                                 ExtendWordSelectionHandler selectioner) {
     try {
+      long stamp = editor.getDocument().getModificationStamp();
       List<TextRange> ranges = selectioner.select(element, text, cursorOffset, editor);
       if (stamp != editor.getDocument().getModificationStamp()) {
         throw new AssertionError("Selectioner " + selectioner + " has changed the document");
       List<TextRange> ranges = selectioner.select(element, text, cursorOffset, editor);
       if (stamp != editor.getDocument().getModificationStamp()) {
         throw new AssertionError("Selectioner " + selectioner + " has changed the document");