Skip to content

Commit 28bfbc7

Browse files
Use RTextArea.begin/endAtomicEdit()
This directly calls beginInternalAtomicEdit() on the UndoManagr, but without needing RsyntaxTextArea to expose its UndoManager (which is an Arduino-specific patch).
1 parent 6f4b03a commit 28bfbc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/processing/app/EditorTab.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -401,14 +401,14 @@ public void setText(String what) {
401401
int oldLength = doc.getLength();
402402
// The undo manager already seems to group the insert and remove together
403403
// automatically, but better be explicit about it.
404-
textarea.getUndoManager().beginInternalAtomicEdit();
404+
textarea.beginAtomicEdit();
405405
try {
406406
doc.insertString(oldLength, what, null);
407407
doc.remove(0, oldLength);
408408
} catch (BadLocationException e) {
409409
System.err.println("Unexpected failure replacing text");
410410
} finally {
411-
textarea.getUndoManager().endInternalAtomicEdit();
411+
textarea.endAtomicEdit();
412412
}
413413
} finally {
414414
caret.setUpdatePolicy(policy);

0 commit comments

Comments
 (0)