introduce function mc/disable-multiple-cursors-mode

This commit is contained in:
Johannes Lippmann
2021-11-11 14:34:17 +01:00
committed by Magnar Sveen
parent 4975afedb3
commit b139bb6b30
3 changed files with 13 additions and 24 deletions

View File

@@ -355,9 +355,7 @@ With zero ARG, skip the last one and mark next."
(when point-first (exchange-point-and-mark)))))
(if (> (mc/num-cursors) 1)
(multiple-cursors-mode 1)
(progn
(multiple-cursors-mode 0)
(run-hooks 'multiple-cursors-mode-disabled-hook))))
(mc/disable-multiple-cursors-mode)))
(defun mc--select-thing-at-point (thing)
(let ((bound (bounds-of-thing-at-point thing)))
@@ -404,9 +402,7 @@ With zero ARG, skip the last one and mark next."
(mc/pop-state-from-overlay first)))
(if (> (mc/num-cursors) 1)
(multiple-cursors-mode 1)
(progn
(multiple-cursors-mode 0)
(run-hooks 'multiple-cursors-mode-disabled-hook)))))))
(mc/disable-multiple-cursors-mode))))))
;;;###autoload
(defun mc/mark-all-in-region-regexp (beg end)
@@ -431,9 +427,7 @@ With zero ARG, skip the last one and mark next."
(error "Search failed for %S" search)))
(goto-char (match-end 0))
(if (< (mc/num-cursors) 3)
(progn
(multiple-cursors-mode 0)
(run-hooks 'multiple-cursors-mode-disabled-hook))
(mc/disable-multiple-cursors-mode)
(mc/pop-state-from-overlay (mc/furthest-cursor-before-point))
(multiple-cursors-mode 1))))))