1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-03-06 00:32:52 +01:00

Clear keymap on reset

This commit is contained in:
Alex Plate 2020-04-22 11:28:37 +03:00
parent 626871e34d
commit ca8d05ff13
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F
2 changed files with 4 additions and 1 deletions
src/com/maddyhome/idea/vim/ui

View File

@ -228,6 +228,7 @@ public class ExEntryPanel extends JPanel {
private void reset() {
deactivate(false);
JTextField.removeKeymap(ExTextField.KEYMAP_NAME);
}
private void resetCaretOffset(@NotNull Editor editor) {

View File

@ -48,6 +48,8 @@ import static java.lang.Math.min;
*/
public class ExTextField extends JTextField {
public final static String KEYMAP_NAME = "ex";
ExTextField() {
// We need to store this in a field, because we can't trust getCaret(), as it will return an instance of
// ComposedTextCaret when working with dead keys or input methods
@ -112,7 +114,7 @@ public class ExTextField extends JTextField {
}
setInputMap(WHEN_FOCUSED, new InputMap());
Keymap map = addKeymap("ex", getKeymap());
Keymap map = addKeymap(KEYMAP_NAME, getKeymap());
loadKeymap(map, ExKeyBindings.INSTANCE.getBindings(), actions);
map.setDefaultAction(new ExEditorKit.DefaultExKeyHandler());
setKeymap(map);