mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
fix(multiple-cursors): "No search pattern" error from evil-mc
Our hacks were too eagerly clearning evil-mc's state. These changes will ensure that doesn't happen. Perhaps its time I package this up into a PR upstream? Fix: #6091
This commit is contained in:
@ -59,13 +59,19 @@
|
|||||||
;; are intended to be perpetually active -- even when no cursors are active
|
;; are intended to be perpetually active -- even when no cursors are active
|
||||||
;; (causing #6021). I undo all of that here.
|
;; (causing #6021). I undo all of that here.
|
||||||
(evil-mc-define-vars)
|
(evil-mc-define-vars)
|
||||||
|
(evil-mc-initialize-vars)
|
||||||
(add-hook 'evil-mc-before-cursors-created #'evil-mc-pause-incompatible-modes)
|
(add-hook 'evil-mc-before-cursors-created #'evil-mc-pause-incompatible-modes)
|
||||||
(add-hook 'evil-mc-before-cursors-created #'evil-mc-initialize-active-state)
|
(add-hook 'evil-mc-before-cursors-created #'evil-mc-initialize-active-state)
|
||||||
(add-hook 'evil-mc-after-cursors-deleted #'evil-mc-teardown-active-state)
|
(add-hook 'evil-mc-after-cursors-deleted #'evil-mc-teardown-active-state)
|
||||||
(add-hook 'evil-mc-after-cursors-deleted #'evil-mc-resume-incompatible-modes)
|
(add-hook 'evil-mc-after-cursors-deleted #'evil-mc-resume-incompatible-modes)
|
||||||
(advice-add #'evil-mc-initialize-hooks :override #'ignore)
|
(advice-add #'evil-mc-initialize-hooks :override #'ignore)
|
||||||
|
(advice-add #'evil-mc-teardown-hooks :override #'evil-mc-initialize-vars)
|
||||||
(advice-add #'evil-mc-initialize-active-state :before #'turn-on-evil-mc-mode)
|
(advice-add #'evil-mc-initialize-active-state :before #'turn-on-evil-mc-mode)
|
||||||
(advice-add #'evil-mc-teardown-active-state :after #'turn-off-evil-mc-mode)
|
(advice-add #'evil-mc-teardown-active-state :after #'turn-off-evil-mc-mode)
|
||||||
|
(defadvice! +multiple-cursors--dont-reinit-vars-a (fn &rest args)
|
||||||
|
:around #'evil-mc-mode
|
||||||
|
(letf! ((#'evil-mc-initialize-vars #'ignore))
|
||||||
|
(apply fn args)))
|
||||||
|
|
||||||
;; REVIEW This is tremendously slow on macos and windows for some reason.
|
;; REVIEW This is tremendously slow on macos and windows for some reason.
|
||||||
(setq evil-mc-enable-bar-cursor (not (or IS-MAC IS-WINDOWS)))
|
(setq evil-mc-enable-bar-cursor (not (or IS-MAC IS-WINDOWS)))
|
||||||
|
Reference in New Issue
Block a user