[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 3e281d0 315/395: ivy-test.el (counsel-find-fi
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 3e281d0 315/395: ivy-test.el (counsel-find-file-single-match-directories): Add test |
Date: |
Thu, 25 Feb 2021 08:32:28 -0500 (EST) |
branch: externals/ivy-hydra
commit 3e281d03b7cf4131b642f001baeabe55a5ce9768
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy-test.el (counsel-find-file-single-match-directories): Add test
Fixes #2596
---
ivy-test.el | 16 ++++++++++++++--
ivy.el | 4 +++-
tests/find-file/single-match-directories/a/file_in_a.txt | 0
.../find-file/single-match-directories/ba/file_in_ba.txt | 0
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/ivy-test.el b/ivy-test.el
index 43f2551..ac1d250 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -1526,10 +1526,22 @@ a buffer visiting a file."
:dir "tests/find-file/directories-with-spaces/"))
"tests/find-file/directories-with-spaces/bar baz ii/file2"))))
+(ert-deftest counsel-find-file-single-match-directories ()
+ (should (string= (let ((ivy-extra-directories nil))
+ (file-relative-name
+ (ivy-with '(counsel-find-file) "a TAB TAB TAB"
+ :dir
"tests/find-file/single-match-directories/")))
+ "tests/find-file/single-match-directories/a/file_in_a.txt"))
+ (should (string= (let ((ivy-extra-directories nil))
+ (file-relative-name
+ (ivy-with '(counsel-find-file) "b TAB TAB TAB"
+ :dir
"tests/find-file/single-match-directories/")))
+
"tests/find-file/single-match-directories/ba/file_in_ba.txt")))
+
(ert-deftest counsel--split-string-with-eol-cr ()
(should
- (equal (counsel--split-string "one\rtwo")
- '("one" "two"))))
+ (equal (counsel--split-string "one\rtwo")
+ '("one" "two"))))
(ert-deftest counsel--split-string-with-eol-lf ()
(should
diff --git a/ivy.el b/ivy.el
index 8177fda..82118b8 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1095,7 +1095,9 @@ If the text hasn't changed as a result, forward to
`ivy-alt-done'."
(when (and
(eq (ivy-state-collection ivy-last) #'read-file-name-internal)
(= 1 (length
- (ivy--re-filter ivy-regex ivy--all-candidates)))
+ (ivy--re-filter
+ (concat "^" (string-remove-prefix "^" ivy-regex))
+ ivy--all-candidates)))
(let ((default-directory ivy--directory))
(file-directory-p (ivy-state-current ivy-last))))
(ivy--directory-done)))
diff --git a/tests/find-file/single-match-directories/a/file_in_a.txt
b/tests/find-file/single-match-directories/a/file_in_a.txt
new file mode 100644
index 0000000..e69de29
diff --git a/tests/find-file/single-match-directories/ba/file_in_ba.txt
b/tests/find-file/single-match-directories/ba/file_in_ba.txt
new file mode 100644
index 0000000..e69de29
- [elpa] externals/ivy-hydra 9e1513f 195/395: ivy.el (ivy--split): Don't split consecutive group brackets, (continued)
- [elpa] externals/ivy-hydra 9e1513f 195/395: ivy.el (ivy--split): Don't split consecutive group brackets, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7b9b3cc 200/395: ivy.el (ivy--switch-buffer-matcher): Complete remote dirs via ":", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 829cf8a 212/395: ivy.el (ivy--done): Set ivy-text, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 95896df 221/395: Honour sentence-end-double-space in recent change, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra c0a960b 216/395: ivy.el (ivy-read): Don't error on "Selecting deleted buffer", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8277a70 197/395: ivy.el (ivy-switch-buffer-transformer): Simplify, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra df41a6d 220/395: counsel.el (counsel-rg-base-command): Double the default max columns, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 51430ff 233/395: counsel.el: Fix candidate splitting when eol is CR or CRLF, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 04ca164 275/395: ivy-resume: resume buffer for counsel-grep, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7dd6bfc 287/395: ivy.el (ivy-read): Document :extra-props as a plist, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3e281d0 315/395: ivy-test.el (counsel-find-file-single-match-directories): Add test,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra d3e14db 303/395: ivy.el (ivy--call-marked): Fix :multi-action with alist collection, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 031ed58 331/395: ivy.el (ivy-call): Remove redundant cond branch, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 453f510 306/395: * ivy-test.el (ivy-avy): Fix skip condition., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 1bf7f91 018/395: counsel.el (counsel--preselect-file): Do not pre-select URL., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 256deea 019/395: swiper.el (swiper--isearch-format): Prepend swiper-line-face property, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 249ccc6 041/395: ivy.el (ivy--split): Re-write, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 69dbbf6 056/395: ivy.el (ivy--tramp-candidates): Extract, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 95d557b 070/395: swiper.el (swiper-query-replace): Add a more straightforward default, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e3fc84f 104/395: counsel.el (counsel--git-grep-occur-cmd): Simplify, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra a159810 120/395: counsel-recentf: Sort by access time when including XDG list., Basil L. Contovounesios, 2021/02/25