aboutsummaryrefslogtreecommitdiff
path: root/evil-common.el
diff options
context:
space:
mode:
authorTom Dalziel <tom_dl@hotmail.com>2023-11-04 19:29:34 +0000
committerTom Dalziel <tom_dl@hotmail.com>2023-11-04 20:34:11 +0000
commitad80a0a185ba1b28d19813e55acabb9d38419657 (patch)
treed59d801e9b342352e4bab764d44cf83579401959 /evil-common.el
parentd28206ccff74bc07ba335b8ff77805564f6928d7 (diff)
Don't disable keypad num fallbacks for digraph's read-key
Diffstat (limited to 'evil-common.el')
-rw-r--r--evil-common.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/evil-common.el b/evil-common.el
index e266e1b..bc5e282 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -565,6 +565,15 @@ as a command. Its main use is in the `evil-read-key-map'."
(interactive)
(read-quoted-char))
+(defvar evil-digraph-read-key-keymap
+ (let ((map (make-sparse-keymap))
+ (n ?0))
+ (while (<= n ?9)
+ (define-key map (kbd (concat "<kp-" (string n) ">")) nil)
+ (cl-incf n))
+ map)
+ "By default, used to exclude otherwise disabled fallbacks.")
+
(declare-function evil-digraph "evil-digraphs")
(defun evil-read-digraph-char-with-overlay (overlay)
"Read two chars, displaying the first in OVERLAY, replacing \"?\".
@@ -572,7 +581,7 @@ Return the digraph from `evil-digraph', else return second char."
(interactive)
(unwind-protect
(let ((read-key-empty-map
- (let ((map (make-sparse-keymap)))
+ (let ((map (copy-keymap evil-digraph-read-key-keymap)))
(set-keymap-parent map read-key-empty-map)
;; Disable read-key-sequence unbound fallbacks, e.g. downcasing
(define-key map [t] 'dummy)