[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9c53320 174/399: swiper.el (swiper-isearch-function): Fix
From: |
Oleh Krehel |
Subject: |
[elpa] master 9c53320 174/399: swiper.el (swiper-isearch-function): Fix for strings with trailing \| |
Date: |
Sat, 20 Jul 2019 14:57:18 -0400 (EDT) |
branch: master
commit 9c53320f7514415b473dd417daced9fa81f0c231
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper-isearch-function): Fix for strings with trailing \|
Need this because in that case the empty string is a match, and
`re-search-forward' does not move point. `isearch-forward-regexp' does
something similar.
* ivy-test.el (swiper-isearch): Add test.
Fixes #2014
---
ivy-test.el | 16 +++++++++++++++-
swiper.el | 3 +++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/ivy-test.el b/ivy-test.el
index 20daa9d..1b9e57a 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -1058,7 +1058,21 @@ a buffer visiting a file."
"abc\na|sdf123 def\ndem"
(global-set-key (kbd "C-s") #'swiper-isearch)
("C-s" "de" "" "RET"))
- "abc\nasd|f123 def\ndem")))
+ "abc\nasd|f123 def\ndem"))
+ (should
+ (string=
+ (ivy-with-text
+ "|(defun foo)\nasdf\n(defvar bar)"
+ (global-set-key (kbd "C-s") #'swiper-isearch)
+ ("C-s" "defun\\|defvar" "RET"))
+ "(defun| foo)\nasdf\n(defvar bar)"))
+ (should
+ (string=
+ (ivy-with-text
+ "|(defun foo)\nasdf\n(defvar bar)"
+ (global-set-key (kbd "C-s") #'swiper-isearch)
+ ("C-s" "defun\\|defvar" "C-n RET"))
+ "(defun foo)\nasdf\n(defvar| bar)")))
(ert-deftest ivy-use-selectable-prompt ()
(let ((ivy-use-selectable-prompt t)
diff --git a/swiper.el b/swiper.el
index 7434b4b..6ea7aa2 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1207,6 +1207,9 @@ come back to the same place as when \"a\" was initially
entered.")
(unless (string= str "")
(let* ((re-full (funcall ivy--regex-function str))
(re (ivy-re-to-str re-full))
+ (re (if (string-match "\\`\\(.*\\)[\\]|\\'" re)
+ (match-string 1 re)
+ re))
(pt-hist (cdr (assoc str swiper--isearch-point-history)))
cands
idx-found
- [elpa] master f38bb51 161/399: ivy.el (ivy--prompt-selectable-p): Allow to select "", (continued)
- [elpa] master f38bb51 161/399: ivy.el (ivy--prompt-selectable-p): Allow to select "", Oleh Krehel, 2019/07/20
- [elpa] master 1b13ee8 162/399: ivy.el (ivy--use-selectable-prompt): Cache ivy--prompt-selected-p, Oleh Krehel, 2019/07/20
- [elpa] master 92ec03c 163/399: ivy-test.el (ivy-use-selectable-prompt): Add tests, Oleh Krehel, 2019/07/20
- [elpa] master b2693d1 160/399: counsel.el (counsel-locate-db-path): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master 44ea8b5 166/399: counsel.el (counsel-git-grep-cmd-function): Add, Oleh Krehel, 2019/07/20
- [elpa] master 502eae6 159/399: counsel.el (counsel--call): Rename to counsel--command, Oleh Krehel, 2019/07/20
- [elpa] master 115efb7 170/399: ivy.el (ivy--sorted-files): Work around all-completions returning $$, Oleh Krehel, 2019/07/20
- [elpa] master 6c858c1 168/399: ivy.el (ivy--filter): Improve performance with :matcher, Oleh Krehel, 2019/07/20
- [elpa] master ba849e5 173/399: ivy.el (ivy--re-filter): Fix for ivy--regex-ignore-order, Oleh Krehel, 2019/07/20
- [elpa] master 5458f93 169/399: ivy.el (ivy--filter): Avoid a filter on empty input, Oleh Krehel, 2019/07/20
- [elpa] master 9c53320 174/399: swiper.el (swiper-isearch-function): Fix for strings with trailing \|,
Oleh Krehel <=
- [elpa] master ce0a1f1 172/399: ivy.el (ivy--filter): Fix matcher not called on input "", Oleh Krehel, 2019/07/20
- [elpa] master 39759cf 180/399: ivy-test.el (ivy-with): Save current buffer, Oleh Krehel, 2019/07/20
- [elpa] master fa87b97 182/399: ivy-test.el: Print version, Oleh Krehel, 2019/07/20
- [elpa] master 8482f62 179/399: swiper.el (swiper-isearch-function): Fix str is " ", Oleh Krehel, 2019/07/20
- [elpa] master 482088c 178/399: swiper.el (swiper--avy-candidates): Fix for swiper-background-faces, Oleh Krehel, 2019/07/20
- [elpa] master 0e62f0d 185/399: counsel.el (counsel-switch-buffer-other-window): Update prompt, Oleh Krehel, 2019/07/20
- [elpa] master 5115df3 184/399: counsel.el: counsel-switch-buffer-other-window: new command., Oleh Krehel, 2019/07/20
- [elpa] master 0a12708 164/399: swiper.el: Add swiper background faces, Oleh Krehel, 2019/07/20
- [elpa] master 7e73580 171/399: ivy-test.el (counsel-find-file-with-dollars): Add test, Oleh Krehel, 2019/07/20
- [elpa] master c47a7dc 176/399: ivy.el (ivy--filter): Don't cache if the result of matching cache is empty, Oleh Krehel, 2019/07/20