From 26c47b1cb71af64349aefb360ca98a67e301dea4 Mon Sep 17 00:00:00 2001 From: Alex Griffin Date: Tue, 11 Apr 2023 19:44:29 -0500 Subject: [PATCH] Use evil-lookup-key when translating keys Makes it possible to indiscriminately translate multi-key sequences like "gj" without errors. Using plain `lookup-key` will end up binding a bunch of keys to a number like 1 instead of a command, because it returns a number when it's passed an invalid sequence of prefix characters. `evil-lookup-key` discards those numbers and returns nil instead. --- evil-collection.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evil-collection.el b/evil-collection.el index 97e282e..8e66ee8 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -744,7 +744,7 @@ without creating/referencing a backup keymap." unless (keywordp key) collect key and collect (when replacement - (lookup-key lookup-keymap replacement))))) + (evil-lookup-key lookup-keymap replacement))))) (unless (or destructive (boundp backup-keymap-symbol)) (set backup-keymap-symbol lookup-keymap)) @@ -775,7 +775,7 @@ without creating/referencing a backup keymap." unless (keywordp key) collect key and collect (when replacement - (lookup-key lookup-keymap replacement))))) + (evil-lookup-key lookup-keymap replacement))))) (unless (or destructive (boundp backup-keymap-symbol)) (set backup-keymap-symbol lookup-keymap))