Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 651 Bytes
// TODO multiple selection
pos = textArea.getCaretPosition();
atStart = pos == 0;
atEnd = textArea.getBufferLength() == pos;
if (!atStart && !atEnd) {
curChar = textArea.getText(pos - 1, 1);
nextChar = textArea.getText(pos, 1);
paren = curChar.equals("(") && nextChar.equals(")");
brace = curChar.equals("{") && nextChar.equals("}");
bracket = curChar.equals("[") && nextChar.equals("]");
quote = curChar.equals("\"") && nextChar.equals("\"");
tic = curChar.equals("'") && nextChar.equals("'");
if (paren || brace || bracket || quote/* || tic */) {
textArea.goToNextCharacter(false);
textArea.backspace();
}
}
textArea.backspace();