int newLength;
boolean isCloseMatch = false;
Rx closingRegex = currentScope.closingRegex;
if (closingRegex != null && closingRegex.usable()) {
//logger.info(String.format("closing regex: '%s'", closingRegex.pattern));
Match match = closingRegex.search(this.line, this.position, this.lineLength);
if (match != null &&
!(match.getCapture(0).start == currentScope.getStart().getLineOffset() &&
currentScope.getStart().getLine() == this.lineIx)
) {
//logger.info(String.format("closing match: %s (%d-%d)", this.currentScope.name, match.getCapture(0).start, match.getCapture(0).end));
Marker newMarker = new Marker();
newMarker.pattern = this.currentScope.pattern;
newMarker.match = match;
newMarker.from = match.getCapture(0).start;
newMarker.isCloseScope = true;
bestMarker = newMarker;
isCloseMatch = true;
} else {
// logger.info(String.format("no close match"));