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:
parent
5081ede268
commit
e1721bf337
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user