summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2015-12-01 01:38:15 +0200
committerJuri Linkov <juri@linkov.net>2015-12-01 01:38:15 +0200
commit5eafc0a7a910db0accac162a59f4709fc2ecec4c (patch)
tree439972d0253160fbe8bc254948ddaaceba79e281 /lisp/replace.el
parent7210f5130abb909aebcbb09a8a71558100fb9f96 (diff)
downloademacs-5eafc0a7a910db0accac162a59f4709fc2ecec4c.tar.gz
* lisp/replace.el (occur-engine): Count matches in empty lines.
(Bug#22062)
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index 21a830da9ca..54b3a71bda2 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1577,6 +1577,9 @@ See also `multi-occur'."
;; Highlight the matches
(let ((len (length curstring))
(start 0))
+ ;; Count empty lines that don't use next loop (Bug#22062).
+ (when (zerop len)
+ (setq matches (1+ matches)))
(while (and (< start len)
(string-match regexp curstring start))
(setq matches (1+ matches))