emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5b10ca8: make smerge-vc-next-conflict wrap around


From: Lars Ingebrigtsen
Subject: master 5b10ca8: make smerge-vc-next-conflict wrap around
Date: Tue, 16 Feb 2021 06:50:01 -0500 (EST)

branch: master
commit 5b10ca8f4f70cbdc51970b8b756d11f1dbf6e2f6
Author: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    make smerge-vc-next-conflict wrap around
    
    * lisp/vc/smerge-mode.el:
    (smerge-vc-next-conflict): While searching for conflict markers,
    wrap search around if current file is the last one with conflicts
    (bug#46538).
---
 lisp/vc/smerge-mode.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index c66a4fb..782c799 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -1468,12 +1468,12 @@ found, uses VC to try and find the next file with 
conflict."
          (if (and (buffer-modified-p) buffer-file-name)
              (save-buffer))
          (vc-find-conflicted-file)
-         (if (eq buffer (current-buffer))
-             ;; Do nothing: presumably `vc-find-conflicted-file' already
-             ;; emitted a message explaining there aren't any more conflicts.
-             nil
-           (goto-char (point-min))
-           (smerge-next)))))))
+         (when (eq buffer (current-buffer))
+           ;; Try to find a conflict marker in current file above the point.
+           (let ((prev-pos (point)))
+             (goto-char (point-min))
+             (unless (ignore-errors (not (smerge-next)))
+               (goto-char prev-pos)))))))))
 
 (provide 'smerge-mode)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]