[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 74095a2 395/399: ivy-test.el (swiper-isearch-backward): Te
From: |
Oleh Krehel |
Subject: |
[elpa] master 74095a2 395/399: ivy-test.el (swiper-isearch-backward): Test match at point |
Date: |
Sat, 20 Jul 2019 14:58:07 -0400 (EDT) |
branch: master
commit 74095a2b9264dd5d1bc1765868ef5af0f6fc2dc2
Author: Andrew Schwartzmeyer <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy-test.el (swiper-isearch-backward): Test match at point
* swiper.el (swiper-isearch): Move the point history by 1 so that we
don't select the match that's right at point.
`isearch-backward` never selects a match at the point, it always goes to
the first match before the point. This test demonstrates the expected
behavior.
Fixes #2150
---
ivy-test.el | 16 +++++++++++++++-
swiper.el | 2 +-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/ivy-test.el b/ivy-test.el
index c58d1a6..386fe9c 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -1147,7 +1147,21 @@ a buffer visiting a file."
"(defun foo)\nasdf\n(defvar bar)|"
(global-set-key (kbd "C-r") #'swiper-isearch-backward)
("C-r" "defun\\|defvar" "C-n RET"))
- "(defun foo)\nasdf\n(|defvar bar)")))
+ "(defun foo)\nasdf\n(|defvar bar)"))
+ (should
+ (string=
+ (ivy-with-text
+ "(defun foo)\nasdf\n(|defun bar)"
+ (global-set-key (kbd "C-r") #'isearch-backward)
+ ("C-r" "defun" "RET"))
+ "(|defun foo)\nasdf\n(defun bar)"))
+ (should
+ (string=
+ (ivy-with-text
+ "(defun foo)\nasdf\n(|defun bar)"
+ (global-set-key (kbd "C-r") #'swiper-isearch-backward)
+ ("C-r" "defun" "RET"))
+ "(|defun foo)\nasdf\n(defun bar)")))
(ert-deftest swiper-isearch-backward-backspace ()
(should
diff --git a/swiper.el b/swiper.el
index cfaf796..9d4fdba 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1520,7 +1520,7 @@ When not running `swiper-isearch' already, start it."
(swiper-font-lock-ensure)
(setq swiper--isearch-point-history
(list
- (cons "" (point))))
+ (cons "" (- (point) (if swiper--isearch-backward 1 0)))))
(let ((ivy-fixed-height-minibuffer t)
(cursor-in-non-selected-windows nil)
(swiper-min-highlight 1)
- [elpa] master 6e50ab6 391/399: ivy-test.el (swiper-isearch-backward): Goto old match on DEL, (continued)
- [elpa] master 6e50ab6 391/399: ivy-test.el (swiper-isearch-backward): Goto old match on DEL, Oleh Krehel, 2019/07/20
- [elpa] master 714911b 389/399: ivy.el (ivy--sort): Higher priority for ivy-sort-matches-functions-alist, Oleh Krehel, 2019/07/20
- [elpa] master 56a1f7d 386/399: Add counsel-grep-backward and counsel-grep-or-swiper-backward commands, Oleh Krehel, 2019/07/20
- [elpa] master 79de883 388/399: ivy.el (ivy--sort): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master f5508e5 390/399: swiper.el (swiper-isearch-backward): Add backward search, Oleh Krehel, 2019/07/20
- [elpa] master af0799a 393/399: counsel.el (counsel-git-log-show-commit-action): Fix match end., Oleh Krehel, 2019/07/20
- [elpa] master 54d1b19 392/399: swiper.el (swiper-isearch-action): Use swiper-action-recenter, Oleh Krehel, 2019/07/20
- [elpa] master 16486d5 394/399: ivy.el (ivy--shorter-matches-first): Add and use for ivy-completion-in-region, Oleh Krehel, 2019/07/20
- [elpa] master f99f13a 396/399: Increase swiper-isearch cursor overlay priority, Oleh Krehel, 2019/07/20
- [elpa] master b5db0aa 397/399: ivy.el (ivy--insert-prompt): Adjust ivy-use-selectable-prompt, Oleh Krehel, 2019/07/20
- [elpa] master 74095a2 395/399: ivy-test.el (swiper-isearch-backward): Test match at point,
Oleh Krehel <=
- [elpa] master 85d1e2e 398/399: doc/Changelog.org: Release 0.12.0, Oleh Krehel, 2019/07/20
- [elpa] master 33689c1 399/399: Merge commit '85d1e2e779ca92e6ef8e47d08f866b13d4d87aee' from ivy, Oleh Krehel, 2019/07/20