[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 07c65b3 325/399: ivy.el (ivy--set-index-dynamic-collection
From: |
Oleh Krehel |
Subject: |
[elpa] master 07c65b3 325/399: ivy.el (ivy--set-index-dynamic-collection): Extract |
Date: |
Sat, 20 Jul 2019 14:57:49 -0400 (EDT) |
branch: master
commit 07c65b319104de2b7fcf4c8cd5402763a1c2a08d
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy--set-index-dynamic-collection): Extract
Re #2112
---
ivy.el | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/ivy.el b/ivy.el
index 90be1e3..03566ca 100644
--- a/ivy.el
+++ b/ivy.el
@@ -606,6 +606,14 @@ When non-nil, ivy will wait until the first chunk of
asynchronous
candidates has been received before selecting the last
preselected candidate.")
+(defun ivy--set-index-dynamic-collection ()
+ (when ivy--trying-to-resume-dynamic-collection
+ (let ((preselect-index
+ (ivy--preselect-index (ivy-state-preselect ivy-last)
ivy--all-candidates)))
+ (when preselect-index
+ (ivy-set-index preselect-index)))
+ (setq ivy--trying-to-resume-dynamic-collection nil)))
+
(defcustom ivy-case-fold-search-default
(if search-upper-case
'auto
@@ -2189,12 +2197,11 @@ This is useful for recursive `ivy-read'."
;; Needed for anchor to work
(setq ivy--old-cands coll)
(setq ivy--old-cands (ivy--filter initial-input coll)))
- (setq ivy--trying-to-resume-dynamic-collection
- (and preselect dynamic-collection))
- (when (and (integerp preselect)
- (not ivy--trying-to-resume-dynamic-collection))
- (setq ivy--old-re "")
- (ivy-set-index preselect))
+ (unless (setq ivy--trying-to-resume-dynamic-collection
+ (and preselect dynamic-collection))
+ (when (integerp preselect)
+ (setq ivy--old-re "")
+ (ivy-set-index preselect)))
(setq ivy--all-candidates coll)
(unless (integerp preselect)
(ivy-set-index (or
@@ -3003,11 +3010,7 @@ Should be run via minibuffer `post-command-hook'."
(setq ivy--old-text ivy-text)))
(when (or ivy--all-candidates
(not (get-process " *counsel*")))
- (when ivy--trying-to-resume-dynamic-collection
- (when-let* ((preselect (ivy-state-preselect ivy-last))
- (preselect-index (ivy--preselect-index preselect
ivy--all-candidates)))
- (ivy-set-index preselect-index))
- (setq ivy--trying-to-resume-dynamic-collection nil))
+ (ivy--set-index-dynamic-collection)
(ivy--insert-minibuffer
(ivy--format ivy--all-candidates))))
(cond (ivy--directory
- [elpa] master 09b9508 321/399: ivy.el (ivy--find-file-action): Fix for virtual buffers, (continued)
- [elpa] master 09b9508 321/399: ivy.el (ivy--find-file-action): Fix for virtual buffers, Oleh Krehel, 2019/07/20
- [elpa] master 7d46450 311/399: Add more information about the collection argument in `ivy-read`., Oleh Krehel, 2019/07/20
- [elpa] master 676a8ee 318/399: swiper.el (swiper-isearch-current-match): Remove unused face, Oleh Krehel, 2019/07/20
- [elpa] master ba626e7 317/399: ivy.el (ivy-next-history-element): Use minibuffer-default for dired-dwim-target, Oleh Krehel, 2019/07/20
- [elpa] master 51e765e 316/399: ivy.el (ivy-partial): Return nil when comletion was not updated, Oleh Krehel, 2019/07/20
- [elpa] master 16d2268 320/399: Fix ivy-push/switch-view windows layout, Oleh Krehel, 2019/07/20
- [elpa] master d260c48 322/399: swiper.el: Obey search-invisible, Oleh Krehel, 2019/07/20
- [elpa] master de8842e 323/399: Add ivy-switch-buffer-map to counsel-switch-buffer, Oleh Krehel, 2019/07/20
- [elpa] master 0d87297 326/399: counsel.el (counsel-open-buffer-file-externally): Cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 7defba2 327/399: ivy.el (ivy-avy): Fix when there's a scroll, Oleh Krehel, 2019/07/20
- [elpa] master 07c65b3 325/399: ivy.el (ivy--set-index-dynamic-collection): Extract,
Oleh Krehel <=
- [elpa] master 400d56f 319/399: counsel.el (counsel-open-buffer-file-externally): New function, Oleh Krehel, 2019/07/20
- [elpa] master 704b1de 328/399: ivy.el (ivy-avy): Allow to scroll with "C-v" and "M-v", Oleh Krehel, 2019/07/20
- [elpa] master 7183491 332/399: ivy.el (ivy--minibuffer-setup): Avoid extra call to ivy--exhibit, Oleh Krehel, 2019/07/20
- [elpa] master a249d15 329/399: ivy-test.el (ivy-avy): Only run if avy is installed, Oleh Krehel, 2019/07/20
- [elpa] master 15f8e10 330/399: .travis.yml: Add emacs-25.3 and emacs-26.2, Oleh Krehel, 2019/07/20
- [elpa] master d752db5 333/399: counsel.el (counsel-find-file-extern-extensions): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master cfb8d49 335/399: counsel.el (counsel-find-file-ignore-regexp): Add lockfiles to dotfiles, Oleh Krehel, 2019/07/20
- [elpa] master 011626a 343/399: ivy.el (ivy-occur-press): Improve when window config changed, Oleh Krehel, 2019/07/20
- [elpa] master 8db9cc1 349/399: swiper.el (swiper--add-cursor-overlay): Avoid a very wide cursor on tab chars, Oleh Krehel, 2019/07/20
- [elpa] master 40d8114 338/399: counsel.el (counsel-shell-command-history): Remove obsolete command, Oleh Krehel, 2019/07/20