[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1b13ee8 162/399: ivy.el (ivy--use-selectable-prompt): Cach
From: |
Oleh Krehel |
Subject: |
[elpa] master 1b13ee8 162/399: ivy.el (ivy--use-selectable-prompt): Cache ivy--prompt-selected-p |
Date: |
Sat, 20 Jul 2019 14:57:15 -0400 (EDT) |
branch: master
commit 1b13ee8a597db3f39546a8a82e2067ddae22cc4e
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy--use-selectable-prompt): Cache ivy--prompt-selected-p
Re #1924
---
ivy.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ivy.el b/ivy.el
index f814bc6..c48c5e3 100644
--- a/ivy.el
+++ b/ivy.el
@@ -690,6 +690,9 @@ prompt is selected wraps around to the last candidate,
while calling
candidate, not the prompt."
:type 'boolean)
+(defvar ivy--use-selectable-prompt nil
+ "Store the effective `ivy-use-selectable-prompt' for current session.")
+
(defun ivy--prompt-selectable-p ()
"Return t if the prompt line is selectable."
(and ivy-use-selectable-prompt
@@ -704,7 +707,7 @@ candidate, not the prompt."
(defun ivy--prompt-selected-p ()
"Return t if the prompt line is selected."
- (and (ivy--prompt-selectable-p)
+ (and ivy--use-selectable-prompt
(= ivy--index -1)))
;;* Commands
@@ -1166,7 +1169,7 @@ If the input is empty, select the previous history
element instead."
(interactive "p")
(setq arg (or arg 1))
(let ((index (- ivy--index arg))
- (min-index (if (ivy--prompt-selectable-p) -1 0)))
+ (min-index (if ivy--use-selectable-prompt -1 0)))
(if (< index min-index)
(if ivy-wrap
(ivy-end-of-buffer)
@@ -2143,6 +2146,7 @@ This is useful for recursive `ivy-read'."
(buffer-substring (region-beginning) (region-end))
(ivy-thing-at-point)))
(setq ivy--prompt (ivy-add-prompt-count (ivy--quote-format-string prompt)))
+ (setq ivy--use-selectable-prompt (ivy--prompt-selectable-p))
(setf (ivy-state-initial-input ivy-last) initial-input)))
(defun ivy-add-prompt-count (prompt)
@@ -2766,7 +2770,7 @@ parts beyond their respective faces `ivy-confirm-face' and
;; Mark prompt as selected if the user moves there or it is the only
;; option left. Since the user input stays put, we have to manually
;; remove the face as well.
- (when (ivy--prompt-selectable-p)
+ (when ivy--use-selectable-prompt
(if (or (= ivy--index -1)
(= ivy--length 0))
(ivy-add-face-text-property
- [elpa] master 0d2ab52 157/399: swiper.el (swiper--isearch-occur-cands): Faster version, (continued)
- [elpa] master 0d2ab52 157/399: swiper.el (swiper--isearch-occur-cands): Faster version, Oleh Krehel, 2019/07/20
- [elpa] master 1bf56c3 165/399: swiper.el (swiper--query-replace-setup): Fix for ivy--regex-ignore-order, Oleh Krehel, 2019/07/20
- [elpa] master 4492054 167/399: ivy.el (ivy--recompute-index): Speed up, Oleh Krehel, 2019/07/20
- [elpa] master 11b0007 158/399: swiper.el (swiper--action): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 1ebbb5f 136/399: swiper.el (swiper-isearch): Set swiper-min-highlight to 1, Oleh Krehel, 2019/07/20
- [elpa] master b34bf45 140/399: counsel.el (counsel-dired): Add, Oleh Krehel, 2019/07/20
- [elpa] master 1e38ed4 146/399: counsel.el (counsel-minor): Add command to toggle minor mode, Oleh Krehel, 2019/07/20
- [elpa] master 2098d27 148/399: swiper.el: Set up occur for swiper-isearch, Oleh Krehel, 2019/07/20
- [elpa] master dceecd8 155/399: swiper.el (swiper-occur): Adapt to swiper-isearch, Oleh Krehel, 2019/07/20
- [elpa] master f38bb51 161/399: ivy.el (ivy--prompt-selectable-p): Allow to select "", Oleh Krehel, 2019/07/20
- [elpa] master 1b13ee8 162/399: ivy.el (ivy--use-selectable-prompt): Cache ivy--prompt-selected-p,
Oleh Krehel <=
- [elpa] master 92ec03c 163/399: ivy-test.el (ivy-use-selectable-prompt): Add tests, Oleh Krehel, 2019/07/20
- [elpa] master b2693d1 160/399: counsel.el (counsel-locate-db-path): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master 44ea8b5 166/399: counsel.el (counsel-git-grep-cmd-function): Add, Oleh Krehel, 2019/07/20
- [elpa] master 502eae6 159/399: counsel.el (counsel--call): Rename to counsel--command, Oleh Krehel, 2019/07/20
- [elpa] master 115efb7 170/399: ivy.el (ivy--sorted-files): Work around all-completions returning $$, Oleh Krehel, 2019/07/20
- [elpa] master 6c858c1 168/399: ivy.el (ivy--filter): Improve performance with :matcher, Oleh Krehel, 2019/07/20
- [elpa] master ba849e5 173/399: ivy.el (ivy--re-filter): Fix for ivy--regex-ignore-order, Oleh Krehel, 2019/07/20
- [elpa] master 5458f93 169/399: ivy.el (ivy--filter): Avoid a filter on empty input, Oleh Krehel, 2019/07/20
- [elpa] master 9c53320 174/399: swiper.el (swiper-isearch-function): Fix for strings with trailing \|, Oleh Krehel, 2019/07/20
- [elpa] master ce0a1f1 172/399: ivy.el (ivy--filter): Fix matcher not called on input "", Oleh Krehel, 2019/07/20