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

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

[nongnu] elpa/flx 3208d8131e 043/182: make undecorate select item more t


From: ELPA Syncer
Subject: [nongnu] elpa/flx 3208d8131e 043/182: make undecorate select item more thorough
Date: Tue, 13 Dec 2022 03:59:24 -0500 (EST)

branch: elpa/flx
commit 3208d8131e746587732a3280a25c838e32f0caf5
Author: Le Wang <le.wang@agworld.com.au>
Commit: Le Wang <le.wang@agworld.com.au>

    make undecorate select item more thorough
    
    - e.g. when selecting directory
---
 flx-ido.el | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/flx-ido.el b/flx-ido.el
index e12725dc67..fb9ea25834 100644
--- a/flx-ido.el
+++ b/flx-ido.el
@@ -13,7 +13,7 @@
 ;; Version: 0.1
 ;; Last-Updated:
 ;;           By:
-;;     Update #: 35
+;;     Update #: 39
 ;; URL:
 ;; Keywords:
 ;; Compatibility:
@@ -163,17 +163,25 @@ item, in which case, the ending items are deleted."
 (defvar flx-ido-use t
   "Use flx matching for ido.")
 
+(defadvice ido-exit-minibuffer (around flx-ido-undecorate activate)
+  "Remove flx properties after."
+  (let* ((obj (car ido-matches))
+         (str (if (consp obj)
+                  (car obj)
+                obj)))
+    (when (and flx-ido-use str)
+      (remove-text-properties 0 (length str)
+                              '(face flx-highlight-face) str)))
+
+  ad-do-it)
+
 (defadvice ido-read-internal (around flx-ido-reset-hash activate)
   "Clear flx narrowed hash beforehand.
 
 Remove flx properties after."
-  (if flx-ido-use
-      (progn
-        (clrhash flx-ido-narrowed-matches-hash)
-        ad-do-it
-        (remove-text-properties 0 (length ad-return-value)
-                                '(face flx-highlight-face) ad-return-value))
-    ad-do-it))
+  (when flx-ido-use
+    (clrhash flx-ido-narrowed-matches-hash))
+  ad-do-it)
 
 (defadvice ido-set-matches-1 (around flx-ido-set-matches-1 activate)
   "Choose between the regular ido-set-matches-1 and my-ido-fuzzy-match"



reply via email to

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