Commit 996884b2 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(diff-end-of-hunk): Be more careful with unified hunks.

parent a1bfe073
......@@ -305,7 +305,11 @@ when editing big diffs)."
(defvar diff-narrowed-to nil)
(defun diff-end-of-hunk (&optional style)
(if (looking-at diff-hunk-header-re) (goto-char (match-end 0)))
(when (looking-at diff-hunk-header-re)
(unless style
;; Especially important for unified (because headers are ambiguous).
(setq style (cdr (assq (char-after) '((?@ . unified) (?* . context))))))
(goto-char (match-end 0)))
(let ((end (and (re-search-forward (case style
;; A `unified' header is ambiguous.
(unified (concat "^[^-+# \\]\\|"
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