branch: elpa/multiple-cursors
commit c94566597a80c07a1782a75644fe1a2ca4f29bad
Merge: ddbe3ae 7cb18b8
Author: Josh Hunsaker <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #294 from nispio/fix-293
Fix bug in mc/mark-all-in-region-regexp. Fixes #293
---
mc-mark-more.el | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/mc-mark-more.el b/mc-mark-more.el
index 27a84b7..2ab7ec7 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -423,16 +423,13 @@ With zero ARG, skip the last one and mark next."
(setq lastmatch (point))
(when (= (point) (match-beginning 0))
(forward-char)))
- (when lastmatch (goto-char lastmatch)))
- (when (> (mc/num-cursors) 0)
- (goto-char (match-end 0)))
- (let ((first (mc/furthest-cursor-before-point)))
- (if (not first)
- (error "Search failed for %S" search)
- (mc/pop-state-from-overlay first)))
- (if (> (mc/num-cursors) 1)
- (multiple-cursors-mode 1)
- (multiple-cursors-mode 0))))))
+ (unless lastmatch
+ (error "Search failed for %S" search)))
+ (goto-char (match-end 0))
+ (if (< (mc/num-cursors) 3)
+ (multiple-cursors-mode 0)
+ (mc/pop-state-from-overlay (mc/furthest-cursor-before-point))
+ (multiple-cursors-mode 1))))))
(when (not (fboundp 'set-temporary-overlay-map))
;; Backport this function from newer emacs versions