mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Autoformat was generating two undo action, the first one being an empty editor. Tested and fixed
This commit is contained in:
@ -92,8 +92,10 @@ public class AStyle implements Tool {
|
||||
int line = getLineOfOffset(textArea);
|
||||
int lineOffset = getLineOffset(textArea, line);
|
||||
|
||||
editor.getTextArea().getUndoManager().beginInternalAtomicEdit();
|
||||
editor.setText(formattedText);
|
||||
editor.getSketch().setModified(true);
|
||||
editor.getTextArea().getUndoManager().endInternalAtomicEdit();
|
||||
|
||||
if (line != -1 && lineOffset != -1) {
|
||||
setCaretPosition(textArea, line, lineOffset);
|
||||
|
Reference in New Issue
Block a user