Merge pull request #252 from bb2020/master

Add defcustom boolean `mc/always-run-for-all`. When non-nil every command will be run for every cursor
This commit is contained in:
Jules Tamangan 2016-06-09 16:11:55 -04:00 committed by GitHub
commit 2ccfc74bf4

View File

@ -310,6 +310,11 @@ cursor with updated info."
(mc/pop-state-from-overlay mc--stored-state-for-undo)
(setq mc--stored-state-for-undo nil)))
(defcustom mc/always-run-for-all nil
"Disables whitelisting and always executes commands for every fake cursor."
:type '(boolean)
:group 'multiple-cursors)
(defun mc/prompt-for-inclusion-in-whitelist (original-command)
"Asks the user, then adds the command either to the once-list or the all-list."
(let ((all-p (y-or-n-p (format "Do %S for all cursors?" original-command))))
@ -399,7 +404,8 @@ the original cursor, to inform about the lack of support."
(when (and original-command
(not (memq original-command mc--default-cmds-to-run-once))
(not (memq original-command mc/cmds-to-run-once))
(or (memq original-command mc--default-cmds-to-run-for-all)
(or mc/always-run-for-all
(memq original-command mc--default-cmds-to-run-for-all)
(memq original-command mc/cmds-to-run-for-all)
(mc/prompt-for-inclusion-in-whitelist original-command)))
(mc/execute-command-for-all-fake-cursors original-command))))))))))