Quellcode durchsuchen

Enable limited flex-matching for dynamic collections

Previously, for dynamic collections, ido-cr+ was limited to prefix
matching. Now all the initially availble completion candidates are
retained, and only dynamically-added candidates are limited to prefix
matching.

This isn't going to be sufficient for functions that implementn
fancier completion behaviors. The solution for those is still
blacklisting.
Ryan C. Thompson vor 8 Jahren
Ursprung
Commit
9f44c78667
1 geänderte Dateien mit 10 neuen und 3 gelöschten Zeilen
  1. 10 3
      ido-completing-read+.el

+ 10 - 3
ido-completing-read+.el

@@ -501,9 +501,16 @@ sets up C-j to be equivalent to TAB in the same situation."
               (def (nth 6 ido-cr+-orig-completing-read-args))
               (predicate (nth 2 ido-cr+-orig-completing-read-args)))
           (setq ido-cur-list
-                (all-completions current-ido-text
-                                 ido-cr+-dynamic-collection
-                                 predicate))
+                (delete-dups
+                 (append
+                  (all-completions
+                   current-ido-text
+                   ido-cr+-dynamic-collection
+                   predicate)
+                  (all-completions
+                   ""
+                   ido-cr+-dynamic-collection
+                   predicate))))
           (unless (listp def)
             (setq def (list def)))
           (when def