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
public boolean accept(Line line, int lineNumber, int beginColumn, int endColumn) {
int column;
String text = line.getText().substring(beginColumn, endColumn);
column = scopeMatcher.searchNextLine(text);
if (column >= 0) {
selectionModel
.setCursorPosition(new LineInfo(line, lineNumber), column + beginColumn);
return false;
}