mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-50578 - assert: TextRange.<init>
This commit is contained in:
+2
-4
@@ -36,7 +36,6 @@ import java.util.List;
|
||||
* @author Gregory.Shrago
|
||||
*/
|
||||
public abstract class BraceMatcherBasedSelectioner extends ExtendWordSelectionHandlerBase {
|
||||
|
||||
@Override
|
||||
public List<TextRange> select(final PsiElement e, final CharSequence editorText, final int cursorOffset, final Editor editor) {
|
||||
final VirtualFile file = e.getContainingFile().getVirtualFile();
|
||||
@@ -60,8 +59,8 @@ public abstract class BraceMatcherBasedSelectioner extends ExtendWordSelectionHa
|
||||
result.addAll(expandToWholeLine(editorText, new TextRange(last.first, iterator.getEnd())));
|
||||
int bodyStart = last.second;
|
||||
int bodyEnd = iterator.getStart();
|
||||
while (bodyStart < textLength && Character.isWhitespace(editorText.charAt(bodyStart))) bodyStart ++;
|
||||
while (bodyEnd > 0 && Character.isWhitespace(editorText.charAt(bodyEnd - 1))) bodyEnd --;
|
||||
while (bodyStart < textLength && Character.isWhitespace(editorText.charAt(bodyStart))) bodyStart++;
|
||||
while (bodyEnd > 0 && bodyStart < bodyEnd && Character.isWhitespace(editorText.charAt(bodyEnd - 1))) bodyEnd--;
|
||||
result.addAll(expandToWholeLine(editorText, new TextRange(bodyStart, bodyEnd)));
|
||||
}
|
||||
iterator.advance();
|
||||
@@ -69,5 +68,4 @@ public abstract class BraceMatcherBasedSelectioner extends ExtendWordSelectionHa
|
||||
result.add(e.getTextRange());
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user