Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (10 sloc) 310 Bytes
pos = textArea.getCaretPosition();
atStart = 0 == pos;
atEnd = textArea.getBufferLength() == pos;
if (!atStart && !atEnd && textArea.getText(pos, 1).equals("}")) {
textArea.insertEnterAndIndent();
textArea.setCaretPosition(pos);
textArea.insertEnterAndIndent();
} else {
textArea.insertEnterAndIndent();
}