diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/Gui.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/gui/Gui.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/Gui.java b/src/main/java/cuchaz/enigma/gui/Gui.java index a61f4dd..dceeaa4 100644 --- a/src/main/java/cuchaz/enigma/gui/Gui.java +++ b/src/main/java/cuchaz/enigma/gui/Gui.java | |||
| @@ -528,14 +528,14 @@ public class Gui { | |||
| 528 | return combo; | 528 | return combo; |
| 529 | } | 529 | } |
| 530 | 530 | ||
| 531 | public void onCaretMove(int pos) { | 531 | public void onCaretMove(int pos, boolean fromClick) { |
| 532 | Token token = this.controller.getToken(pos); | 532 | Token token = this.controller.getToken(pos); |
| 533 | boolean isToken = token != null; | 533 | boolean isToken = token != null; |
| 534 | 534 | ||
| 535 | cursorReference = this.controller.getReference(token); | 535 | cursorReference = this.controller.getReference(token); |
| 536 | Entry<?> referenceEntry = cursorReference != null ? cursorReference.entry : null; | 536 | Entry<?> referenceEntry = cursorReference != null ? cursorReference.entry : null; |
| 537 | 537 | ||
| 538 | if (referenceEntry != null && shouldNavigateOnClick) { | 538 | if (referenceEntry != null && shouldNavigateOnClick && fromClick) { |
| 539 | shouldNavigateOnClick = false; | 539 | shouldNavigateOnClick = false; |
| 540 | Entry<?> navigationEntry = referenceEntry; | 540 | Entry<?> navigationEntry = referenceEntry; |
| 541 | if (cursorReference.context == null) { | 541 | if (cursorReference.context == null) { |
| @@ -768,8 +768,9 @@ public class Gui { | |||
| 768 | if (response == JOptionPane.YES_OPTION) { | 768 | if (response == JOptionPane.YES_OPTION) { |
| 769 | this.saveMapping(); | 769 | this.saveMapping(); |
| 770 | this.frame.dispose(); | 770 | this.frame.dispose(); |
| 771 | } else if (response == JOptionPane.NO_OPTION) | 771 | } else if (response == JOptionPane.NO_OPTION) { |
| 772 | this.frame.dispose(); | 772 | this.frame.dispose(); |
| 773 | } | ||
| 773 | 774 | ||
| 774 | return null; | 775 | return null; |
| 775 | }, "Save and exit", "Discard changes", "Cancel"); | 776 | }, "Save and exit", "Discard changes", "Cancel"); |