Commit 49188503 authored by Stefan Monnier's avatar Stefan Monnier

* lisp/vc/diff-mode.el: Better handle empty lines in context diffs

(diff-end-of-hunk): Obey diff-valid-unified-empty-line for context style.
(diff--refine-hunk): Don't look further than the end.
parent b7a98993
Pipeline #1069 failed with stage
in 59 minutes and 52 seconds
......@@ -533,7 +533,8 @@ See https://lists.gnu.org/r/emacs-devel/2007-11/msg01990.html")
"^[^-+# \\\n]\\|" "^[^-+# \\]\\|")
;; A `unified' header is ambiguous.
diff-file-header-re))
('context "^[^-+#! \\]")
('context (if diff-valid-unified-empty-line
"^[^-+#! \n\\]" "^[^-+#! \\]"))
('normal "^[^<>#\\]")
(_ "^[^-+#!<> \\]"))
nil t)
......@@ -2116,7 +2117,7 @@ Return new point, if it was moved."
(smerge-refine-regions beg-del beg-add beg-add end-add
nil #'diff-refine-preproc props-r props-a)))))
('context
(let* ((middle (save-excursion (re-search-forward "^---")))
(let* ((middle (save-excursion (re-search-forward "^---" end)))
(other middle))
(while (re-search-forward "^\\(?:!.*\n\\)+" middle t)
(smerge-refine-regions (match-beginning 0) (match-end 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment