Skip to content

Commit

Permalink
Fix an issue that the Tab key is displayed as i in the shortcut key
Browse files Browse the repository at this point in the history
prompt menu
  • Loading branch information
ab9986 committed Feb 17, 2025
1 parent 1a88329 commit c4d26f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions meow-keypad.el
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ command when there's one available on current key sequence."
(setq meow--use-literal t))
(meow--keypad-keys
(if (and meow-keypad-capital-letter-add-ctrl (equal 'control (caar (last meow--keypad-keys))))
(if (equal (upcase key) key)
(if (and (equal (upcase key) key) (= (length key) 1))
(push (cons 'control (downcase key)) meow--keypad-keys)
(push (cons 'literal key) meow--keypad-keys))
(push (cons 'control key) meow--keypad-keys)))
Expand All @@ -512,7 +512,7 @@ command when there's one available on current key sequence."
(if-let* ((keymap (meow--get-leader-keymap)))
(setq meow--keypad-base-keymap keymap)
(setq meow--keypad-keys (meow--parse-string-to-keypad-keys meow-keypad-leader-dispatch)))
(if (and meow-keypad-capital-letter-add-ctrl (equal (upcase key) key))
(if (and meow-keypad-capital-letter-add-ctrl (equal (upcase key) key) (= (length key) 1))
(push (cons 'control (downcase key)) meow--keypad-keys)
(push (cons 'literal key) meow--keypad-keys)))))
;; Try execute if the input is valid.
Expand Down
9 changes: 7 additions & 2 deletions meow-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,14 @@ Looks up the state in meow-replace-state-name-list"
(if (and (integerp (event-basic-type e))
(member 'shift (event-modifiers e)))
(upcase (event-basic-type e))
(if (and meow-keypad-capital-letter-add-ctrl (string-prefix-p "C-" (key-description (vector e))) (characterp (event-basic-type e)))
(let ((key-des (key-description (vector e))))
(if (and meow-keypad-capital-letter-add-ctrl (string-prefix-p "C-" key-des) (characterp (event-basic-type e)))
(upcase (event-basic-type e))
(event-basic-type e))))
(if (string-equal-ignore-case key-des "tab")
key-des
(event-basic-type e)
)
))))

(defun meow--ensure-visible ()
(let ((overlays (overlays-at (1- (point))))
Expand Down

0 comments on commit c4d26f7

Please sign in to comment.