diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/diff-mode.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index f6b2520a112..d41bfcad58a 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -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 "^[^-+# \\]\\|" |