[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 6369139 271/395: ivy.el (ivy--update-history)
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 6369139 271/395: ivy.el (ivy--update-history): Behave more like completing-read-default |
Date: |
Thu, 25 Feb 2021 08:32:18 -0500 (EST) |
branch: externals/ivy-hydra
commit 63691397998e8c86931e1887c9f060a8b595d3b2
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el (ivy--update-history): Behave more like completing-read-default
For `ivy-completing-read'.
* ivy-test.el (ivy-completing-read): Add test.
Fixes #2369
---
ivy-test.el | 13 +++++++++++--
ivy.el | 4 +++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/ivy-test.el b/ivy-test.el
index 08ffb6e..182b613 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -31,6 +31,8 @@
(defvar ivy-features nil
"Like `features' but for Ivy testing purposes.")
+(defvar ivy-read-hist nil)
+
(defun ivy-test--record-feature (feature &rest _)
"Record FEATURE in `ivy-features'.
Intended as :after-while advice for `require'."
@@ -188,7 +190,6 @@ Since `execute-kbd-macro' doesn't pick up a let-bound
`default-directory'.")
"one")))
(ert-deftest ivy-read-history ()
- (defvar ivy-read-hist nil)
(should (equal (progn
(setq ivy-read-hist '("c" "b" "a"))
(ivy-with '(ivy-read "test: " '("c" "d") :history
'ivy-read-hist) "RET")
@@ -835,7 +836,15 @@ Since `execute-kbd-macro' doesn't pick up a let-bound
`default-directory'.")
(should (equal (ivy-with '(ivy-completing-read
"Test: " '(("1" . "a") ("2" . "b")))
"RET")
- "1")))
+ "1"))
+ (should (equal (progn
+ (setq ivy-read-hist '("foo"))
+ (ivy-with
+ '(completing-read "test: " '("foo" "bar" "baz") nil t nil
+ 'ivy-read-hist)
+ "fo RET")
+ ivy-read-hist)
+ '("foo"))))
(ert-deftest ivy-completing-read-def-handling ()
;; DEF in COLLECTION
diff --git a/ivy.el b/ivy.el
index b0bd76d..1d48ebf 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2307,7 +2307,8 @@ customizations apply to the current completion session."
(defun ivy--update-history (hist)
(let ((item
- (if (string= ivy-text "")
+ (if (or (string= ivy-text "")
+ (eq (ivy-state-extra-props ivy-last) 'ivy-completing-read))
(ivy-state-current ivy-last)
ivy-text)))
(cond ((equal item ""))
@@ -2605,6 +2606,7 @@ INHERIT-INPUT-METHOD is currently ignored."
:history history
:keymap nil
:dynamic-collection ivy-completing-read-dynamic-collection
+ :extra-props 'ivy-completing-read
:caller (if (and collection (symbolp collection))
collection
this-command))))
- [elpa] externals/ivy-hydra 24e68ea 225/395: counsel.el (counsel-git-log-cmd): Disable coloring., (continued)
- [elpa] externals/ivy-hydra 24e68ea 225/395: counsel.el (counsel-git-log-cmd): Disable coloring., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra cfb395e 239/395: counsel.el (counsel--sync-sentinel-on-exit): Simplify, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f4a7d87 241/395: Fix recent addition of caddr in counsel.el, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b91a4e2 238/395: counsel.el (counsel--git-grep-index): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 781cbbc 255/395: Advertise ivy-string< over string-lessp, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0e4a55f 242/395: ivy.el (ivy--preselect-index): Don't return nil, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra af2a5fa 247/395: * counsel.el (counsel-pt): Fix counsel-ag usage, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4aa8073 264/395: ivy.el (ivy-call): Make "M-x cd" work again, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d1ba9b8 269/395: ivy.el (ivy-resume): Refresh on modified buffer for swiper-isearch, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5e67e7c 268/395: counsel.el (counsel-rg): Split command args independent of the order, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6369139 271/395: ivy.el (ivy--update-history): Behave more like completing-read-default,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra c0dc909 277/395: ivy.el (ivy-resume): Support multiple ivy sessions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8989ed1 276/395: ivy.el (ivy--update-minibuffer): don't filter while there's input, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d790e53 278/395: doc/ivy.org: Mention multiple-session ivy-resume, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra fb8804d 280/395: ivy.el (ivy--call-marked): Extract, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 489bc57 284/395: counsel.el (counsel-rg-base-command): Make the default a list, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7fd0662 285/395: counsel.el (counsel-grep-like-occur): Fix for marked files in dired, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f1c57a1 292/395: counsel.el (counsel-async-command-delay): Set the default to 0.0, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra fb73bfe 288/395: counsel.el (counsel--rg-targets): Fix regression, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 2b26f83 289/395: counsel.el (counsel--sync-sentinel-on-exit): Don't reset index, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6a576cb 293/395: ivy-avy.el: Extract, Basil L. Contovounesios, 2021/02/25