]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/smerge-mode.el (smerge-match-conflict): Fix bug#38456
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 21 Jan 2020 20:58:17 +0000 (15:58 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 21 Jan 2020 20:58:17 +0000 (15:58 -0500)
This situation is not an internal error, but a perfectly normal occurrence,
so a `cl-assert` is not right

lisp/vc/smerge-mode.el

index d4984bbd38ba392ac198b1da27f760ba05650753..85868b91ecc6f5531b0c699d45beba4af30c3fc8 100644 (file)
@@ -797,7 +797,10 @@ An error is raised if not inside a conflict."
               (filename (or (match-string 1) ""))
 
               (_ (re-search-forward smerge-end-re))
-              (_ (cl-assert (< orig-point (match-end 0))))
+              (_ (when (< (match-end 0) orig-point)
+                   ;; Point is not within the conflict we found,
+                    ;; so this conflict is not ours.
+                   (signal 'search-failed (list smerge-begin-re))))
 
               (lower-end (match-beginning 0))
               (end (match-end 0))