Skip to content

Commit 31ef19a

Browse files
committed
tweak(smerge): extract the custom +smerge-vc-next-conflict-recenter
1 parent b4e7eb1 commit 31ef19a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

core/me-builtin.el

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,14 @@ current line.")
889889
(goto-char (point-max))
890890
(smerge-prev))
891891

892+
(defun +smerge-vc-next-conflict-recenter ()
893+
"Go to next conflict, possibly in another file."
894+
(interactive)
895+
(smerge-vc-next-conflict)
896+
;; Often, after calling `smerge-vc-next-conflict', the cursor will land at
897+
;; the bottom of the window.
898+
(recenter-top-bottom (/ (window-height) 8)))
899+
892900
(with-eval-after-load 'hydra
893901
(defhydra +smerge-hydra (:hint nil
894902
:pre (if (not smerge-mode) (smerge-mode 1))
@@ -927,9 +935,7 @@ current line.")
927935
("C" smerge-combine-with-next)
928936
("r" smerge-resolve)
929937
("R" smerge-kill-current)
930-
;; Often after calling `smerge-vc-next-conflict', the cursor will land at
931-
;; the bottom of the window
932-
("n" (progn (smerge-vc-next-conflict) (recenter-top-bottom (/ (window-height) 8))))
938+
("n" +smerge-vc-next-conflict-recenter)
933939
("q" nil :color blue))))
934940

935941
(use-package octave

0 commit comments

Comments
 (0)