Fix #4421: masquerade doom/escape as keyboard-quit
Or abort-recursive-edit, depending. Some other packages/commands listen for these two (like undo-fu), and by remapping C-g we break those.
This commit is contained in:
parent
eea4709354
commit
5d3496575c
1 changed files with 3 additions and 1 deletions
|
@ -77,13 +77,15 @@ all hooks after it are ignored.")
|
|||
(interactive)
|
||||
(cond ((minibuffer-window-active-p (minibuffer-window))
|
||||
;; quit the minibuffer if open.
|
||||
(setq this-command 'abort-recursive-edit)
|
||||
(abort-recursive-edit))
|
||||
;; Run all escape hooks. If any returns non-nil, then stop there.
|
||||
((run-hook-with-args-until-success 'doom-escape-hook))
|
||||
;; don't abort macros
|
||||
((or defining-kbd-macro executing-kbd-macro) nil)
|
||||
;; Back to the default
|
||||
((keyboard-quit))))
|
||||
((setq this-command 'keyboard-quit)
|
||||
(keyboard-quit))))
|
||||
|
||||
(global-set-key [remap keyboard-quit] #'doom/escape)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue