new LineInfo(selectionModel.getCursorLine(), selectionModel.getCursorLineNumber());
String text = selectionModel.getCursorLine().getText();
final char cursorChar = text.charAt(selectionModel.getCursorColumn());
final char searchChar;
final boolean searchingForward = OPENING_GROUPS.indexOf(cursorChar) >= 0;
final Position searchingTo;
if (searchingForward) {
searchChar = CLOSING_GROUPS.charAt(OPENING_GROUPS.indexOf(cursorChar));
searchingTo =
new Position(new LineInfo(document.getLastLine(), document.getLastLineNumber()),
document.getLastLine().length());
} else if (CLOSING_GROUPS.indexOf(cursorChar) >= 0) {
searchChar = OPENING_GROUPS.charAt(CLOSING_GROUPS.indexOf(cursorChar));
searchingTo = new Position(new LineInfo(document.getFirstLine(), 0), 0);
} else {
return true; // not on a valid starting character
}
Position startingPosition = new Position(cursorLineInfo, selectionModel.getCursorColumn()
+ (searchingForward ? 0 : 1));
PositionUtils.visit(new LineUtils.LineVisitor() {
// keep a stack to match the correct corresponding bracket
ScopeMatcher scopeMatcher = new ScopeMatcher(searchingForward, cursorChar, searchChar);
@Override