Fix bug in mc/mark-all-in-region-regexp. Fixes #293

This commit is contained in:
Josh Hunsaker 2017-06-29 16:30:04 -07:00
parent ddbe3ae932
commit 7cb18b8aec

View File

@ -423,16 +423,13 @@ With zero ARG, skip the last one and mark next."
(setq lastmatch (point)) (setq lastmatch (point))
(when (= (point) (match-beginning 0)) (when (= (point) (match-beginning 0))
(forward-char))) (forward-char)))
(when lastmatch (goto-char lastmatch))) (unless lastmatch
(when (> (mc/num-cursors) 0) (error "Search failed for %S" search)))
(goto-char (match-end 0))) (goto-char (match-end 0))
(let ((first (mc/furthest-cursor-before-point))) (if (< (mc/num-cursors) 3)
(if (not first) (multiple-cursors-mode 0)
(error "Search failed for %S" search) (mc/pop-state-from-overlay (mc/furthest-cursor-before-point))
(mc/pop-state-from-overlay first))) (multiple-cursors-mode 1))))))
(if (> (mc/num-cursors) 1)
(multiple-cursors-mode 1)
(multiple-cursors-mode 0))))))
(when (not (fboundp 'set-temporary-overlay-map)) (when (not (fboundp 'set-temporary-overlay-map))
;; Backport this function from newer emacs versions ;; Backport this function from newer emacs versions