mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-13 21:03:05 +00:00
Add hooks when mc-mode is enabled and disabled.
They are named `multiple-cursors-mode-enabled-hook` and `multiple-cursors-mode-disabled-hook`. Fixes #6
This commit is contained in:
parent
491b206472
commit
16563e32d1
@ -276,9 +276,12 @@ multiple cursors editing.")
|
|||||||
"Mode while multiple cursors are active."
|
"Mode while multiple cursors are active."
|
||||||
nil " mc" mc/keymap
|
nil " mc" mc/keymap
|
||||||
(if multiple-cursors-mode
|
(if multiple-cursors-mode
|
||||||
(add-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t t)
|
(progn
|
||||||
|
(add-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t t)
|
||||||
|
(run-hooks 'multiple-cursors-mode-enabled-hook))
|
||||||
(remove-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t)
|
(remove-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t)
|
||||||
(mc/remove-fake-cursors)))
|
(mc/remove-fake-cursors)
|
||||||
|
(run-hooks 'multiple-cursors-mode-disabled-hook)))
|
||||||
|
|
||||||
(add-hook 'after-revert-hook #'(lambda () (multiple-cursors-mode 0)))
|
(add-hook 'after-revert-hook #'(lambda () (multiple-cursors-mode 0)))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user