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

Handle backspace via vim with active lookup

This commit is contained in:
Alex Plate 2019-05-21 16:53:52 +03:00
parent 5081ede268
commit e1721bf337
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F

View File

@ -159,7 +159,7 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
if (editor != null && keyStroke != null) {
final int keyCode = keyStroke.getKeyCode();
if (LookupManager.getActiveLookup(editor) != null) {
return isExitInsertMode(keyStroke);
return isEnabledForLookup(keyStroke);
}
if (keyCode == VK_ESCAPE) {
return isEnabledForEscape(editor);
@ -213,13 +213,17 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
.anyMatch(fileEditor -> editor.equals(EditorUtil.getEditorEx(fileEditor)));
}
private boolean isExitInsertMode(@NotNull KeyStroke keyStroke) {
private boolean isEnabledForLookup(@NotNull KeyStroke keyStroke) {
for (List<KeyStroke> keys : InsertExitModeAction.getInstance().getKeyStrokesSet()) {
// XXX: Currently we cannot handle <C-\><C-N> because of the importance of <C-N> for the IDE on Linux
if (keys.size() == 1 && keyStroke.equals(keys.get(0))) {
return true;
}
}
//noinspection RedundantIfStatement
if (keyStroke.equals(KeyStroke.getKeyStroke(VK_BACK_SPACE, 0))) {
return true;
}
return false;
}