//we have to check if smartIndent is -1 because otherwise we are inside some bracket
if (smartIndent == -1 && !isInsidePar && StringUtils.isClosingPeer(lastChar)) {
//ok, not inside brackets
PythonPairMatcher matcher = new PythonPairMatcher(StringUtils.BRACKETS);
int bracketOffset = selection.getLineOffset() + curr;
IRegion region = matcher.match(document, bracketOffset + 1);
if (region != null) {
if (!PySelection.endsInSameLine(document, region)) {
//we might not have a match if there is an error in the program...
//e.g. a single ')' without its counterpart.
int openingBracketLine = document.getLineOfOffset(region.getOffset());