summaryrefslogtreecommitdiff
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 5a01793d06e..c57613dff51 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -1251,7 +1251,8 @@ Only works for unified diffs."
(cond
((and diff-valid-unified-empty-line
;; Not just (eolp) so we don't infloop at eob.
- (eq (char-after) ?\n))
+ (eq (char-after) ?\n)
+ (> before 0) (> after 0))
(decf before) (decf after) t)
((and (zerop before) (zerop after)) nil)
((or (< before 0) (< after 0))