branch: externals/ivy-hydra
commit d4e17ee10aeba5dc3a02c9d2233b066cabd9d986
Author: wouter bolsterlee <[email protected]>
Commit: Oleh Krehel <[email protected]>
Also remember search history when using swiper-isearch
Fixes #2293
Fixes #2294
---
swiper.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/swiper.el b/swiper.el
index 3e3e2b0..d8c6f54 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1100,6 +1100,7 @@ WND, when specified is the window."
(swiper--remember-search-history re)))))
(defun swiper--remember-search-history (re)
+ "Add the search pattern RE to the search history ring."
(add-to-history
'regexp-search-ring
re
@@ -1460,7 +1461,8 @@ that we search only for one character."
(goto-char (match-beginning 0)))
(isearch-range-invisible (point) (1+ (point)))
(swiper--maybe-recenter)
- (unless (eq ivy-exit 'done)
+ (if (eq ivy-exit 'done)
+ (swiper--remember-search-history (ivy--regex ivy-text))
(swiper--cleanup)
(swiper--delayed-add-overlays)
(swiper--add-cursor-overlay