emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ivy-hydra a2c86c0 273/395: ivy.el (ivy-completion-in-re


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra a2c86c0 273/395: ivy.el (ivy-completion-in-region): Fixup
Date: Thu, 25 Feb 2021 08:32:18 -0500 (EST)

branch: externals/ivy-hydra
commit a2c86c0c993e4f340aafec3bb3866a602343d72a
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy-completion-in-region): Fixup
    
    Fixes #2562
    
    Use a predicate that handles `elisp-completion-at-point' in the new
    way, while handling the rest in the old way.
    
    It's difficult to have truly dynamic completion at point via
    `ivy-completion-in-region', since COLLECTION can be created pre-cached
    on the buffer contents (as is in case of `bash-completion') from
    `completion-at-point-functions'.
---
 ivy.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ivy.el b/ivy.el
index cc1d6d3..0e16a97 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2718,14 +2718,20 @@ See `completion-in-region' for further information."
                      (setf (ivy-state-window ivy-last) (selected-window)))
                    (ivy-completion-in-region-action
                     (substring-no-properties (car comps))))
+               (dolist (s comps)
+                 ;; Remove face `completions-first-difference'.
+                 (ivy--remove-props s 'face))
                (setq ivy--old-re nil)
                (unless (ivy--filter initial comps)
                  (setq initial nil)
                  (setq predicate nil)
                  (setq collection comps))
+               (if (functionp collection)
+                   (setq collection comps)
+                 (setq initial (concat "^" initial)))
                (ivy-read (format "(%s): " str) collection
                          :predicate predicate
-                         :initial-input (concat "^" initial)
+                         :initial-input initial
                          :action #'ivy-completion-in-region-action
                          :unwind (lambda ()
                                    (unless (eq ivy-exit 'done)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]