[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 6f50fca 286/395: ivy.el: When reading file na
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 6f50fca 286/395: ivy.el: When reading file names, take the non-directory part of :initial-input |
Date: |
Thu, 25 Feb 2021 08:32:21 -0500 (EST) |
branch: externals/ivy-hydra
commit 6f50fca8710a28a4de94dd121d764ba46fecbbbd
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el: When reading file names, take the non-directory part of
:initial-input
* ivy-test.el (ivy-read-file-name-initial-input): Add test
Fixes #1632
---
ivy-test.el | 20 ++++++++++++++++++++
ivy.el | 4 +---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/ivy-test.el b/ivy-test.el
index fd0b463..3d1a5cb 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -1065,6 +1065,26 @@ Since `execute-kbd-macro' doesn't pick up a let-bound
`default-directory'.")
"DEL C-M-j"
:dir "/tmp"))))
+(ert-deftest ivy-read-file-name-initial-input ()
+ (let ((fname (expand-file-name "ivy.el")))
+ (should (string=
+ fname
+ (ivy-with
+ `(ivy-read "Find file: " 'read-file-name-internal
+ :predicate 'file-exists-p
+ :require-match 'confirm-after-completion
+ :initial-input ,fname
+ :preselect ,fname
+ :def ,fname
+ :history 'file-name-history
+ :keymap nil
+ :sort t
+ :dynamic-collection nil
+ :caller 'read-file-name-internal
+ :action (lambda (x) x))
+ "RET"))))
+ (should (string= (ivy-state-initial-input ivy-last) "ivy.el")))
+
(ert-deftest ivy-counsel-read-directory-name ()
(should
(equal (expand-file-name "/tmp/")
diff --git a/ivy.el b/ivy.el
index 08c93d4..d591e8e 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2485,9 +2485,7 @@ This is useful for recursive `ivy-read'."
(equal initial-input default-directory)
(equal initial-input ""))
(setq coll (cons initial-input coll)))
- (when (or (not (ivy-state-action ivy-last))
- (equal (ivy--get-action ivy-last) #'identity))
- (setq initial-input nil))))
+ (setq initial-input (file-name-nondirectory initial-input))))
((eq collection #'internal-complete-buffer)
(setq coll (ivy--buffer-list
""
- [elpa] externals/ivy-hydra a4a22e0 294/395: ivy.el (ivy-display-style): Remove, (continued)
- [elpa] externals/ivy-hydra a4a22e0 294/395: ivy.el (ivy-display-style): Remove, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ee747e6 290/395: ivy.el (ivy--update-history): Use ivy-state-current for file names, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f67a2bb 215/395: ivy.el (ivy--filter): Prioritize :matcher, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ca89b5d 236/395: ivy.el (ivy--recompute-index): Don't call ivy-set-index twice, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra bd80852 251/395: Fix punctuation in some error messages, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8383dd6 248/395: * counsel.el: Unquote lambda actions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6916cbd 256/395: doc/ivy.org: Document ivy-insert-current-full, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ace2475 260/395: counsel.el (counsel--sync-sentinel-on-exit): Fix regression, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f1472ef 266/395: ivy.el: When completing files, make "RET" reverse "DEL", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 82cb9da 272/395: ivy.el (ivy--do-shrink-window): Account for the extra prompt height, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6f50fca 286/395: ivy.el: When reading file names, take the non-directory part of :initial-input,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra d452878 291/395: counsel-grep/ag/rg/pt/...: Allow to deplay subprocess creation, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 84dfbf8 296/395: ivy-avy.el: Checkdoc, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 864570a 323/395: ivy.el (ivy--get-multi-action): Fix and add a test, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 05c12fc 310/395: counsel.el (counsel--grep-smart-case-flag): Check if base command is a string, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b2af619 322/395: ivy.el (ivy--call-marked): Don't call multi-action if non-default action was chosen, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 683a7b7 309/395: ivy.el (ivy-completion-in-region): Fix "^" and C-g, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ea9bd06 353/395: Encode --pcre switch correctly for ivy-occur, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 63549da 354/395: Fix counsel-descbinds for Emacs 28, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 387390b 312/395: Prefer derived-mode-p for major-mode comparisons, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8d840b2 317/395: counsel.el (counsel-find-file-undo): Undo changing current directory, Basil L. Contovounesios, 2021/02/25