mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 05:39:18 +01:00
Merge pull request #3693 from joelmoniz/bugfix-autoformatUndo
Make auto-format into a compund edit
This commit is contained in:
@@ -2207,6 +2207,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
if (formattedText.equals(source)) {
|
||||
statusNotice(Language.text("editor.status.autoformat.no_changes"));
|
||||
} else {
|
||||
startCompoundEdit();
|
||||
// replace with new bootiful text
|
||||
// selectionEnd hopefully at least in the neighborhood
|
||||
int scrollPos = textarea.getVerticalScrollPosition();
|
||||
@@ -2227,6 +2228,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
textarea.setVerticalScrollPosition(scrollPos);
|
||||
// }
|
||||
}
|
||||
stopCompoundEdit();
|
||||
getSketch().setModified(true);
|
||||
// mark as finished
|
||||
statusNotice(Language.text("editor.status.autoformat.finished"));
|
||||
|
||||
Reference in New Issue
Block a user