branch: master
commit eb829a96783c5d77c13fc8ced3f59afa6bbd0e64
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
Account for zero-length regex matches
* swiper.el (swiper--add-overlays): Update.
Fixes #6.
---
swiper.el | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/swiper.el b/swiper.el
index e88d658..6970968 100644
--- a/swiper.el
+++ b/swiper.el
@@ -242,7 +242,8 @@
(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)