[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 180d329 365/399: swiper.el (swiper--re-builder): Improve f
From: |
Oleh Krehel |
Subject: |
[elpa] master 180d329 365/399: swiper.el (swiper--re-builder): Improve for char-fold-to-regexp |
Date: |
Sat, 20 Jul 2019 14:58:00 -0400 (EDT) |
branch: master
commit 180d3290f636f0fe9dc0ed3a61632fa9b057ac73
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper--re-builder): Improve for char-fold-to-regexp
- Capture each part into a group
- Set `ivy--subexps' so that each match group is highlighted
- Switch from greedy to non-greedy
* swiper.el (swiper--delayed-add-overlays): Use
`swiper--positive-regexps' so that `swiper-isearch' highlighting
works better.
Fixes #2124
---
swiper.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/swiper.el b/swiper.el
index c2caeb2..f13ea28 100644
--- a/swiper.el
+++ b/swiper.el
@@ -709,7 +709,12 @@ line numbers. For the buffer, use `ivy--regex' instead."
(setq ivy--subexps 1))
(format "^ %s" re))))
((eq (bound-and-true-p search-default-mode)
'char-fold-to-regexp)
- (mapconcat #'char-fold-to-regexp (ivy--split str) ".*"))
+ (let ((subs (ivy--split str)))
+ (setq ivy--subexps (length subs))
+ (mapconcat
+ (lambda (s) (format "\\(%s\\)" (char-fold-to-regexp s)))
+ subs
+ ".*?")))
(t
(funcall re-builder str)))))
re))
@@ -1331,7 +1336,8 @@ that we search only for one character."
(lambda ()
(with-ivy-window
(swiper--add-overlays (ivy--regex ivy-text))))))
- (swiper--add-overlays (ivy--regex ivy-text))))
+ (dolist (re (swiper--positive-regexps ivy-text))
+ (swiper--add-overlays re))))
(defun swiper-isearch-action (x)
"Move to X for `swiper-isearch'."
- [elpa] master d52c176 351/399: ivy.el (ivy-switch-buffer-kill): Move from "C-c C-k" to "C-k", (continued)
- [elpa] master d52c176 351/399: ivy.el (ivy-switch-buffer-kill): Move from "C-c C-k" to "C-k", Oleh Krehel, 2019/07/20
- [elpa] master 7925637 353/399: ivy.el (ivy--compute-extra-candidates): Extract, Oleh Krehel, 2019/07/20
- [elpa] master f6876a7 359/399: ivy.el (ivy-read): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 460d6e3 355/399: ivy.el (ivy-read): Refactor, Oleh Krehel, 2019/07/20
- [elpa] master ebac0e9 352/399: ivy.el (ivy--compute-extra-actions): Extract, Oleh Krehel, 2019/07/20
- [elpa] master bae8e46 361/399: ivy.el (ivy--magic-file-doubleslash-directory): Cd remote "/" on "//", Oleh Krehel, 2019/07/20
- [elpa] master a87bdd2 358/399: ivy.el (ivy-read): Refactor, Oleh Krehel, 2019/07/20
- [elpa] master 5e1c468 357/399: ivy.el (ivy--cleanup): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 520fd83 360/399: ivy.el (ivy-read): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 2d22e05 363/399: doc/ivy.org: Add more info on TRAMP, Oleh Krehel, 2019/07/20
- [elpa] master 180d329 365/399: swiper.el (swiper--re-builder): Improve for char-fold-to-regexp,
Oleh Krehel <=
- [elpa] master 4e9e310 368/399: ivy.el (ivy-read): Fix swiper-query-replace not working, Oleh Krehel, 2019/07/20
- [elpa] master a0b71a1 362/399: ivy.el (ivy--magic-tilde-directory): Cd remote "~" on "~", Oleh Krehel, 2019/07/20
- [elpa] master 3af75cf 364/399: swiper.el (swiper--positive-regexps): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 916e281 367/399: ivy.el (ivy-read): Fix bad refactor, Oleh Krehel, 2019/07/20
- [elpa] master 1ea4ebb 370/399: Fix minor typo, Oleh Krehel, 2019/07/20
- [elpa] master 2fa7cec 366/399: ivy-test.el (swiper--re-builder): Add test, Oleh Krehel, 2019/07/20
- [elpa] master 57e77a5 372/399: counsel.el (counsel-git-log-split-string-re): Change., Oleh Krehel, 2019/07/20
- [elpa] master 72a827a 373/399: counsel.el (counsel-git-log): Add additional action., Oleh Krehel, 2019/07/20
- [elpa] master 259cf07 374/399: Fix ivy-previous-line-or-history, Oleh Krehel, 2019/07/20
- [elpa] master d91f61d 378/399: counsel.el (counsel--split-string): Extract, Oleh Krehel, 2019/07/20