Explorar el Código

Don't use ido for an empty collection

Ryan C. Thompson hace 8 años
padre
commit
d852a31a3b
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      ido-completing-read+.el

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

@@ -209,6 +209,9 @@ completion for them."
                      (member "" collection))
                      (member "" collection))
             (signal 'ido-cr+-fallback
             (signal 'ido-cr+-fallback
                     '("ido cannot handle the empty string as an option when `ido-enable-dot-prefix' is non-nil; see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26997")))
                     '("ido cannot handle the empty string as an option when `ido-enable-dot-prefix' is non-nil; see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26997")))
+          ;; No point in using ido unless there's a collection
+          (when (= (length collection) 0)
+            (signal 'ido-cr+-fallback '("ido is not needed for an empty collection")))
           ;; Check for excessively large collection
           ;; Check for excessively large collection
           (when (and ido-cr+-max-items
           (when (and ido-cr+-max-items
                      (> (length collection) ido-cr+-max-items))
                      (> (length collection) ido-cr+-max-items))