mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-13 21:03:05 +00:00
Add support for running lambdas for each cursor.
- can't know if it's safe, so we assume it is.
This commit is contained in:
parent
822bf18adf
commit
de0519e0f0
@ -132,14 +132,21 @@ is executed normally for point, but skipped for the fake
|
|||||||
cursors."
|
cursors."
|
||||||
(let ((original-command (or (command-remapping this-original-command)
|
(let ((original-command (or (command-remapping this-original-command)
|
||||||
this-original-command)))
|
this-original-command)))
|
||||||
(if (get original-command 'mc--unsupported)
|
|
||||||
(message "%S is not supported with multiple cursors%s"
|
;; if it's a lambda, we can't know if it's supported or not
|
||||||
original-command
|
;; - so go ahead and assume it's ok, because we're just optimistic like that
|
||||||
(get original-command 'mc--unsupported))
|
(if (not (symbolp original-command))
|
||||||
(if (not (memq original-command mc--cmds))
|
(mc/execute-command-for-all-fake-cursors original-command)
|
||||||
(when (not (memq original-command mc--cmds-run-once))
|
|
||||||
(message "Skipping %S" original-command))
|
;; otherwise it's a symbol, and we can be more thorough
|
||||||
(mc/execute-command-for-all-fake-cursors original-command)))))
|
(if (get original-command 'mc--unsupported)
|
||||||
|
(message "%S is not supported with multiple cursors%s"
|
||||||
|
original-command
|
||||||
|
(get original-command 'mc--unsupported))
|
||||||
|
(if (not (memq original-command mc--cmds))
|
||||||
|
(when (not (memq original-command mc--cmds-run-once))
|
||||||
|
(message "Skipping %S" original-command))
|
||||||
|
(mc/execute-command-for-all-fake-cursors original-command))))))
|
||||||
|
|
||||||
(defun mc/remove-fake-cursors ()
|
(defun mc/remove-fake-cursors ()
|
||||||
"Remove all fake cursors.
|
"Remove all fake cursors.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user