changeset 44860:72ec4ee68d47

(occur-engine): Make nlines argument actually mean number of context lines. Handle it.
author Colin Walters <walters@gnu.org>
date Thu, 25 Apr 2002 21:12:09 +0000
parents 3eea5fbe1501
children de1bcec6e403
files lisp/replace.el
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/replace.el	Thu Apr 25 21:10:44 2002 +0000
+++ b/lisp/replace.el	Thu Apr 25 21:12:09 2002 +0000
@@ -779,7 +779,7 @@
 				 curstring
 				 "\n"))
 			       (data
-				(if (= nlines 1)
+				(if (= nlines 0)
 				    ;; The simple display style
 				    out-line
 				 ;; The complex multi-line display
@@ -787,14 +787,14 @@
 				 ;; concatenate them all together.
 				 (apply #'concat
 					(nconc
-					 (add-prefix (nreverse (cdr (occur-accumulate-lines (- nlines) t))))
+					 (add-prefix (nreverse (cdr (occur-accumulate-lines (- (1+ nlines)) t))))
 					 (list out-line)
-					 (add-prefix (cdr (occur-accumulate-lines nlines t))))))))
+					 (add-prefix (cdr (occur-accumulate-lines (1+ nlines) t))))))))
 			  ;; Actually insert the match display data
 			  (with-current-buffer out-buf
 			    (let ((beg (point))
 				  (end (insert-get-point data)))
-			      (unless (= nlines 1)
+			      (unless (= nlines 0)
 				(insert-get-point "-------\n"))
 			      (add-text-properties
 			       beg (1- end)