diff options
| -rw-r--r-- | enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java index b285689e..e0a299f5 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java | |||
| @@ -35,6 +35,7 @@ import javax.swing.text.Document; | |||
| 35 | import javax.swing.text.Highlighter.HighlightPainter; | 35 | import javax.swing.text.Highlighter.HighlightPainter; |
| 36 | 36 | ||
| 37 | import de.sciss.syntaxpane.DefaultSyntaxKit; | 37 | import de.sciss.syntaxpane.DefaultSyntaxKit; |
| 38 | import de.sciss.syntaxpane.SyntaxDocument; | ||
| 38 | 39 | ||
| 39 | import cuchaz.enigma.EnigmaProject; | 40 | import cuchaz.enigma.EnigmaProject; |
| 40 | import cuchaz.enigma.analysis.EntryReference; | 41 | import cuchaz.enigma.analysis.EntryReference; |
| @@ -504,6 +505,11 @@ public class EditorPanel { | |||
| 504 | this.editor.getHighlighter().removeAllHighlights(); | 505 | this.editor.getHighlighter().removeAllHighlights(); |
| 505 | this.editor.setText(source.toString()); | 506 | this.editor.setText(source.toString()); |
| 506 | 507 | ||
| 508 | // We don't care about the undo/redo history of the syntax pane, any change history would be stored separately | ||
| 509 | if (this.editor.getDocument() instanceof SyntaxDocument syntaxDocument) { | ||
| 510 | syntaxDocument.clearUndos(); | ||
| 511 | } | ||
| 512 | |||
| 507 | if (this.source != null) { | 513 | if (this.source != null) { |
| 508 | this.editor.setCaretPosition(newCaretPos); | 514 | this.editor.setCaretPosition(newCaretPos); |
| 509 | } | 515 | } |