EA-50578 - assert: TextRange.<init>

This commit is contained in:
Sergey Ignatov
2013-11-06 15:16:13 +04:00
parent aa20e7da83
commit dc52633d55
@@ -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;
}
}