[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra eb83a3c 110/395: ivy.el (ivy--update-minibuff
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra eb83a3c 110/395: ivy.el (ivy--update-minibuffer): Extract |
Date: |
Thu, 25 Feb 2021 08:31:42 -0500 (EST) |
branch: externals/ivy-hydra
commit eb83a3cda80c63893dede39c63ab4fd7222eea81
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el (ivy--update-minibuffer): Extract
---
ivy.el | 95 ++++++++++++++++++++++++++++++++++--------------------------------
1 file changed, 49 insertions(+), 46 deletions(-)
diff --git a/ivy.el b/ivy.el
index 3bd7104..cb0a0a1 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3267,52 +3267,55 @@ Should be run via minibuffer `post-command-hook'."
(let ((inhibit-field-text-motion nil))
(constrain-to-field nil (point-max)))
(ivy-set-text (ivy--input))
- (if (ivy-state-dynamic-collection ivy-last)
- ;; while-no-input would cause annoying
- ;; "Waiting for process to die...done" message interruptions
- (let ((inhibit-message t)
- coll in-progress)
- (unless (equal ivy--old-text ivy-text)
- (while-no-input
- (setq coll (funcall (ivy-state-collection ivy-last) ivy-text))
- (when (eq coll 0)
- (setq coll nil)
- (setq ivy--old-re nil)
- (setq in-progress t))
- (setq ivy--all-candidates (ivy--sort-maybe coll))
- (setq ivy--old-text ivy-text)))
- (when (eq ivy--all-candidates 0)
- (setq ivy--all-candidates nil)
- (setq ivy--old-re nil)
- (setq in-progress t))
- (when (or ivy--all-candidates
- (and (not (get-process " *counsel*"))
- (not in-progress)))
- (ivy--set-index-dynamic-collection)
- (ivy--insert-minibuffer
- (ivy--format ivy--all-candidates))))
- (cond (ivy--directory
- (cond ((or (string= "~/" ivy-text)
- (and (string= "~" ivy-text)
- ivy-magic-tilde))
- (ivy--cd (ivy--magic-tilde-directory ivy--directory)))
- ((string-match "/\\'" ivy-text)
- (ivy--magic-file-slash))))
- ((eq (ivy-state-collection ivy-last) #'internal-complete-buffer)
- (when (or (and (string-match "\\` " ivy-text)
- (not (string-match "\\` " ivy--old-text)))
- (and (string-match "\\` " ivy--old-text)
- (not (string-match "\\` " ivy-text))))
- (setq ivy--all-candidates
- (if (= (string-to-char ivy-text) ?\s)
- (ivy--buffer-list " ")
- (ivy--buffer-list "" ivy-use-virtual-buffers)))
- (setq ivy--old-re nil))))
- (ivy--insert-minibuffer
- (with-current-buffer (ivy-state-buffer ivy-last)
- (ivy--format
- (ivy--filter ivy-text ivy--all-candidates))))
- (setq ivy--old-text ivy-text))))
+ (ivy--update-minibuffer)))
+
+(defun ivy--update-minibuffer ()
+ (if (ivy-state-dynamic-collection ivy-last)
+ ;; while-no-input would cause annoying
+ ;; "Waiting for process to die...done" message interruptions
+ (let ((inhibit-message t)
+ coll in-progress)
+ (unless (equal ivy--old-text ivy-text)
+ (while-no-input
+ (setq coll (funcall (ivy-state-collection ivy-last) ivy-text))
+ (when (eq coll 0)
+ (setq coll nil)
+ (setq ivy--old-re nil)
+ (setq in-progress t))
+ (setq ivy--all-candidates (ivy--sort-maybe coll))
+ (setq ivy--old-text ivy-text)))
+ (when (eq ivy--all-candidates 0)
+ (setq ivy--all-candidates nil)
+ (setq ivy--old-re nil)
+ (setq in-progress t))
+ (when (or ivy--all-candidates
+ (and (not (get-process " *counsel*"))
+ (not in-progress)))
+ (ivy--set-index-dynamic-collection)
+ (ivy--insert-minibuffer
+ (ivy--format ivy--all-candidates))))
+ (cond (ivy--directory
+ (cond ((or (string= "~/" ivy-text)
+ (and (string= "~" ivy-text)
+ ivy-magic-tilde))
+ (ivy--cd (ivy--magic-tilde-directory ivy--directory)))
+ ((string-match "/\\'" ivy-text)
+ (ivy--magic-file-slash))))
+ ((eq (ivy-state-collection ivy-last) #'internal-complete-buffer)
+ (when (or (and (string-match "\\` " ivy-text)
+ (not (string-match "\\` " ivy--old-text)))
+ (and (string-match "\\` " ivy--old-text)
+ (not (string-match "\\` " ivy-text))))
+ (setq ivy--all-candidates
+ (if (= (string-to-char ivy-text) ?\s)
+ (ivy--buffer-list " ")
+ (ivy--buffer-list "" ivy-use-virtual-buffers)))
+ (setq ivy--old-re nil))))
+ (ivy--insert-minibuffer
+ (with-current-buffer (ivy-state-buffer ivy-last)
+ (ivy--format
+ (ivy--filter ivy-text ivy--all-candidates))))
+ (setq ivy--old-text ivy-text)))
(defun ivy-display-function-fallback (str)
(let ((buffer-undo-list t))
- [elpa] externals/ivy-hydra f8eb450 077/395: counsel.el (counsel-register): Fix for file registers in Emacs 27, (continued)
- [elpa] externals/ivy-hydra f8eb450 077/395: counsel.el (counsel-register): Fix for file registers in Emacs 27, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7d94e67 087/395: Use the current prompt for shell history initial input, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ce70661 095/395: counsel.el (counsel-grep-function): Simplfy and extend, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 51fe2ce 097/395: counsel.el (counsel--recentf-get-xdg-recent-files): Decode utf-8, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra fb6db46 093/395: counsel.el (counsel-flycheck-occur): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e3a72a5 096/395: Add XDG recent files to counsel-recentf., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 00e5e0d 099/395: Apply resize to window size change hook., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4875c7b 101/395: ivy.el (ivy-current-match): Add :extend t, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5430e11 107/395: ivy.el (ivy-regex): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f40a465 117/395: ivy.el (ivy-avy-style): New defcustom, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra eb83a3c 110/395: ivy.el (ivy--update-minibuffer): Extract,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 5974f06 124/395: counsel.el (counsel-evil-marks): Improve, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b8dd986 112/395: swiper.el (swiper-isearch-format-function): Fix for ivy-prescient, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 526c7aa 113/395: counsel-org-tag-action: message when a tag has been removed., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3fa1677 118/395: counsel.el (counsel--imenu-candidates): Use "Functions" only for Elisp, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra baddac7 129/395: counsel-kmacro: Handle potential error from `edmacro-fix-menu-commands`., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 03be27a 127/395: counsel-kmacro: Small corrections in a few doc strings., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ff59888 136/395: ivy.el (ivy-read-action-format-columns): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4d497e2 132/395: Add support for adding additional multi-actions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 27b2ae5 141/395: Don't hardcode C-s and C-r, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6a902b5 145/395: counsel.el (string-trim-left): Add declare-function, Basil L. Contovounesios, 2021/02/25