Skip to content

Commit

Permalink
Don't disable keypad num fallbacks for digraph's read-key
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed Nov 4, 2023
1 parent d28206c commit ad80a0a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion evil-common.el
Original file line number Diff line number Diff line change
Expand Up @@ -565,14 +565,23 @@ 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 \"?\".
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)
Expand Down

0 comments on commit ad80a0a

Please sign in to comment.