From b43ce8da1bc51dcd9558fbbd79d821c112bfcc70 Mon Sep 17 00:00:00 2001 From: Lucas Bullen Date: Fri, 24 Aug 2018 10:47:19 -0400 Subject: [PATCH] Issue #174 Contextual menu for comments commands - Relies on https://git.eclipse.org/r/#/c/128034/ - Creates popup option for the comment commands for users to quickly see the key activation sequences of each command - Fixes small issue with mulit-char auto inserts moving the caret too far Signed-off-by: Lucas Bullen --- .../plugin.xml | 65 +++++++++++++------ ...LanguageConfigurationAutoEditStrategy.java | 2 +- 2 files changed, 45 insertions(+), 22 deletions(-) diff --git a/org.eclipse.tm4e.languageconfiguration/plugin.xml b/org.eclipse.tm4e.languageconfiguration/plugin.xml index 209336279..65915471e 100644 --- a/org.eclipse.tm4e.languageconfiguration/plugin.xml +++ b/org.eclipse.tm4e.languageconfiguration/plugin.xml @@ -141,39 +141,21 @@ class="org.eclipse.tm4e.languageconfiguration.ToggleLineCommentHandler" commandId="org.eclipse.tm4e.languageconfiguration.togglelinecommentcommand"> - - - - + - - - - + - - - - + @@ -187,4 +169,45 @@ type="java.lang.Object"> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/LanguageConfigurationAutoEditStrategy.java b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/LanguageConfigurationAutoEditStrategy.java index b2ea83048..74c1af31d 100644 --- a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/LanguageConfigurationAutoEditStrategy.java +++ b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/LanguageConfigurationAutoEditStrategy.java @@ -66,7 +66,7 @@ public void customizeDocumentCommand(IDocument document, DocumentCommand command continue; } command.text += autoClosingPair.getValue(); - command.caretOffset = command.offset + autoClosingPair.getValue().length(); + command.caretOffset = command.offset + 1; command.shiftsCaret = false; break; }