]> code.delx.au - gnu-emacs-elpa/commitdiff
Account for zero-length regex matches
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 13 Mar 2015 21:25:28 +0000 (22:25 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 13 Mar 2015 21:25:28 +0000 (22:25 +0100)
* swiper.el (swiper--add-overlays): Update.

Fixes #6.

swiper.el

index e88d658be877b2a091cf98cd30f5008b5c7b8449..6970968b098564157df14908778b8282e89b5602 100644 (file)
--- a/swiper.el
+++ b/swiper.el
     (save-excursion
       (goto-char beg)
       ;; RE can become an invalid regexp
-      (while (ignore-errors (re-search-forward re end t))
+      (while (and (ignore-errors (re-search-forward re end t))
+                  (> (- (match-end 0) (match-beginning 0)) 0))
         (let ((i 0))
           (while (<= i ivy--subexps)
             (when (match-beginning i)