diff options
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r-- | lisp/diff-mode.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index f39256c2281..609c5ef6490 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -110,6 +110,8 @@ when editing big diffs)." ("N" . diff-file-next) ("p" . diff-hunk-prev) ("P" . diff-file-prev) + ("\t" . diff-hunk-next) + ([backtab] . diff-hunk-prev) ("k" . diff-hunk-kill) ("K" . diff-file-kill) ;; From compilation-minor-mode. @@ -1269,7 +1271,16 @@ Only works for unified diffs." (while (case (char-after) (?\s (decf before) (decf after) t) - (?- (decf before) t) + (?- + (if (and (looking-at diff-file-header-re) + (zerop before) (zerop after)) + ;; No need to query: this is a case where two patches + ;; are concatenated and only counting the lines will + ;; give the right result. Let's just add an empty + ;; line so that our code which doesn't count lines + ;; will not get confused. + (progn (save-excursion (insert "\n")) nil) + (decf before) t)) (?+ (decf after) t) (t (cond |