changeset 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 7b6b4d9ae726
children 42040974ab42
files lisp/diff-mode.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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 "^[^-+# \\]\\|"