editor/multiple-cursors: better command whitelist

+ Fixes explicit usage of evil-escape from evil-mc cursors (e.g. M-x
  evil-escape or C-g, not the escape sequences jk/fd)
+ Fixes delete-char (DEL key) from cursors
+ Fixes all custom commands when used with a COUNT
This commit is contained in:
Henrik Lissner 2018-09-23 10:25:58 -04:00
parent 5fd0699158
commit c2c7def192
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -27,8 +27,10 @@
;; Add custom commands to whitelisted commands ;; Add custom commands to whitelisted commands
(dolist (fn '(doom/backward-to-bol-or-indent doom/forward-to-last-non-comment-or-eol (dolist (fn '(doom/backward-to-bol-or-indent doom/forward-to-last-non-comment-or-eol
doom/backward-kill-to-bol-and-indent)) doom/backward-kill-to-bol-and-indent delete-char))
(add-to-list 'evil-mc-custom-known-commands `(,fn (:default . evil-mc-execute-default-call)))) (add-to-list 'evil-mc-custom-known-commands `(,fn (:default . evil-mc-execute-default-call-with-count))))
;; Have evil-mc work with explicit `evil-escape' (typically bound to C-g)
(add-to-list 'evil-mc-custom-known-commands '(evil-escape (:default . evil-mc-execute-default-evil-normal-state)))
;; Activate evil-mc cursors upon switching to insert mode ;; Activate evil-mc cursors upon switching to insert mode
(defun +evil-mc|resume-cursors () (setq evil-mc-frozen nil)) (defun +evil-mc|resume-cursors () (setq evil-mc-frozen nil))