diff options
Diffstat (limited to 'enigma-swing/src')
| -rw-r--r-- | enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java index dd9971a7..a45ecc93 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java | |||
| @@ -14,6 +14,8 @@ import javax.swing.text.Document; | |||
| 14 | import javax.swing.text.Highlighter; | 14 | import javax.swing.text.Highlighter; |
| 15 | import javax.swing.text.Highlighter.HighlightPainter; | 15 | import javax.swing.text.Highlighter.HighlightPainter; |
| 16 | 16 | ||
| 17 | import de.sciss.syntaxpane.DefaultSyntaxKit; | ||
| 18 | |||
| 17 | import cuchaz.enigma.EnigmaProject; | 19 | import cuchaz.enigma.EnigmaProject; |
| 18 | import cuchaz.enigma.analysis.EntryReference; | 20 | import cuchaz.enigma.analysis.EntryReference; |
| 19 | import cuchaz.enigma.classhandle.ClassHandle; | 21 | import cuchaz.enigma.classhandle.ClassHandle; |
| @@ -42,7 +44,6 @@ import cuchaz.enigma.translation.representation.entry.FieldEntry; | |||
| 42 | import cuchaz.enigma.translation.representation.entry.MethodEntry; | 44 | import cuchaz.enigma.translation.representation.entry.MethodEntry; |
| 43 | import cuchaz.enigma.utils.I18n; | 45 | import cuchaz.enigma.utils.I18n; |
| 44 | import cuchaz.enigma.utils.Result; | 46 | import cuchaz.enigma.utils.Result; |
| 45 | import de.sciss.syntaxpane.DefaultSyntaxKit; | ||
| 46 | 47 | ||
| 47 | public class PanelEditor { | 48 | public class PanelEditor { |
| 48 | 49 | ||
| @@ -574,6 +575,9 @@ public class PanelEditor { | |||
| 574 | // make sure the token is visible in the scroll window | 575 | // make sure the token is visible in the scroll window |
| 575 | Rectangle start = this.editor.modelToView(token.start); | 576 | Rectangle start = this.editor.modelToView(token.start); |
| 576 | Rectangle end = this.editor.modelToView(token.end); | 577 | Rectangle end = this.editor.modelToView(token.end); |
| 578 | if (start == null || end == null) { | ||
| 579 | return; | ||
| 580 | } | ||
| 577 | Rectangle show = start.union(end); | 581 | Rectangle show = start.union(end); |
| 578 | show.grow(start.width * 10, start.height * 6); | 582 | show.grow(start.width * 10, start.height * 6); |
| 579 | SwingUtilities.invokeLater(() -> this.editor.scrollRectToVisible(show)); | 583 | SwingUtilities.invokeLater(() -> this.editor.scrollRectToVisible(show)); |