mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-23 07:19:15 +00:00
Make diff--refine-hunk bug out less on broken patches
* lisp/vc/diff-mode.el (diff--refine-hunk): Don't bug out on broken patches where we can't find the middle.
This commit is contained in:
parent
dc01b992e2
commit
54c2a8df3b
@ -2173,9 +2173,10 @@ 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 "^---" end)))
|
||||
(let* ((middle (save-excursion (re-search-forward "^---" end t)))
|
||||
(other middle))
|
||||
(while (re-search-forward "^\\(?:!.*\n\\)+" middle t)
|
||||
(while (and middle
|
||||
(re-search-forward "^\\(?:!.*\n\\)+" middle t))
|
||||
(smerge-refine-regions (match-beginning 0) (match-end 0)
|
||||
(save-excursion
|
||||
(goto-char other)
|
||||
|
Loading…
Reference in New Issue
Block a user