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

This commit is contained in:
Stefan Monnier 2004-04-16 21:52:14 +00:00
parent a1bfe073ea
commit 996884b257

View file

@ -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 "^[^-+# \\]\\|"