summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
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))