Quellcode durchsuchen

Remove display properties from return value of ido-completing-read+

Fixes #179.

Functions like `read-from-kill-ring' add display properties for things
like ellipses, which need to be removed before returning the
completion.
Ryan C. Thompson vor 1 Jahr
Ursprung
Commit
1609049c0a
1 geänderte Dateien mit 13 neuen und 4 gelöschten Zeilen
  1. 13 4
      ido-completing-read+.el

+ 13 - 4
ido-completing-read+.el

@@ -776,10 +776,19 @@ See `completing-read' for the meaning of the arguments."
                     ;; Reset this for recursive calls to ido-cr+
                     (ido-cr+-assume-static-collection nil))
                 (unwind-protect
-                    (ido-completing-read
-                     prompt collection
-                     predicate require-match initial-input hist def
-                     inherit-input-method)
+                    (let ((return-value
+                           (ido-completing-read
+                            prompt collection
+                            predicate require-match initial-input hist def
+                            inherit-input-method)))
+                      ;; Functions like `read-from-kill-ring' add
+                      ;; display properties for things like ellipses,
+                      ;; which need to be removed. (Somehow
+                      ;; `completing-read-default' removes these
+                      ;; properties from its return value, though I
+                      ;; don't understand how.)
+                      (remove-text-properties 0 (length return-value) '(display) return-value)
+                      return-value)
                   (when ido-cr+-dynamic-update-timer
                     (cancel-timer ido-cr+-dynamic-update-timer)
                     (setq ido-cr+-dynamic-update-timer nil))))