Mercurial > emacs
diff lisp/diff-mode.el @ 54928:28a55e2ec30f
(diff-end-of-hunk): Be more careful with unified hunks.
| author | Stefan Monnier <monnier@iro.umontreal.ca> |
|---|---|
| date | Fri, 16 Apr 2004 21:52:14 +0000 |
| parents | c491468e3c18 |
| children | 386e33861abd |
line wrap: on
line diff
--- a/lisp/diff-mode.el Fri Apr 16 21:19:16 2004 +0000 +++ b/lisp/diff-mode.el Fri Apr 16 21:52:14 2004 +0000 @@ -305,7 +305,11 @@ (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 "^[^-+# \\]\\|"
