branch: master
commit b5e869ee605fd60ac0852933665023189d22c82c
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
swiper.el (swiper--occur-cands): Fix wgrep
Didn't work before because every line had one extra space.
Fixes #2156
---
swiper.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/swiper.el b/swiper.el
index 96a36b5..ff1e88c 100644
--- a/swiper.el
+++ b/swiper.el
@@ -604,14 +604,16 @@ such as `scroll-conservatively' are set to a high value.")
(if (eq (ivy-state-caller ivy-last) 'swiper-isearch)
(swiper--isearch-occur-cands cands)
(mapcar (lambda (s)
- (cons
- (get-text-property 0 'swiper-line-number s)
- s))
+ (let ((n (get-text-property 0 'swiper-line-number
s)))
+ (setq s (substring s 1))
+ (add-text-properties 0 1 (list 'swiper-line-number
n) s)
+ (cons n s)))
cands)))
(offset (+ (length fname) 2)))
(mapcar (lambda (x)
(let ((nn (number-to-string
(+ (car x) line-delta))))
+ (remove-text-properties 0 1 '(display) (cdr x))
(put-text-property 0 (length nn) 'face
'ivy-grep-line-number nn)
(put-text-property 0 1 'offset (+ offset (length nn))
fname)
(format "%s:%s:%s" fname nn (cdr x))))