(diff-end-of-hunk): Be more careful with unified hunks.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 16 Apr 2004 21:52:14 +0000 (21:52 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 16 Apr 2004 21:52:14 +0000 (21:52 +0000)
lisp/diff-mode.el

index f6b2520..d41bfca 100644 (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 "^[^-+# \\]\\|"