Skip to content

Commit 55eb96d

Browse files
committed
tweak(multiple-cursors): minor tweaks in the integration with symbol-overlay
1 parent a975058 commit 55eb96d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

modules/me-multi-cursors.el

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@
8181
;; Integrate with `symbol-overlay'
8282
(with-eval-after-load 'symbol-overlay
8383
;; https://lmno.lol/alvaro/its-all-up-for-grabs-and-it-compounds
84-
(defun +mc/mark-all-symbol-overlays ()
85-
"Mark all symbol overlays using multiple cursors."
86-
(interactive)
87-
(mc/remove-fake-cursors)
84+
(defun +mc/mark-all-symbol-overlays (&optional discard)
85+
"Mark all symbol overlays using multiple cursors.
86+
When DISCARD is non-nil, discard the current cursors before creating the
87+
new ones."
88+
(interactive "P")
89+
(when discard (mc/remove-fake-cursors))
8890
(when-let* ((overlays (symbol-overlay-get-list 0))
8991
(point (point))
9092
(point-overlay (seq-find
@@ -104,7 +106,11 @@
104106

105107
(with-eval-after-load 'transient
106108
;; Add to the transient menu after the "s"
107-
(transient-append-suffix '+mc/transient "s" '("S" "symbol overlays" +mc/mark-all-symbol-overlays)))))
109+
(transient-append-suffix '+mc/transient "s" '("S" "symbol overlays" +mc/mark-all-symbol-overlays)))
110+
111+
(with-eval-after-load 'casual-symbol-overlay
112+
(transient-append-suffix 'casual-symbol-overlay-tmenu '(-2)
113+
["Multiple cursors" ("c" "Mark all" +mc/mark-all-symbol-overlays)]))))
108114

109115

110116
(provide 'me-multi-cursors)

0 commit comments

Comments
 (0)