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.
This commit is contained in:
Alex Griffin 2023-04-11 19:44:29 -05:00 committed by James
parent d3b497db31
commit 26c47b1cb7
1 changed files with 2 additions and 2 deletions

View File

@ -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))