branch: externals/vertico commit 030b9644efd5c289c635ced17c73b5c72cf362f6 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
vertico--flatten-string: Handle display space properties correctly --- vertico.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vertico.el b/vertico.el index b7a62e5..29ba089 100644 --- a/vertico.el +++ b/vertico.el @@ -335,11 +335,13 @@ "Flatten STR with display or invisible PROP." (let ((end (length str)) (pos 0) (chunks)) (while (< pos end) - (let ((next (next-single-property-change pos prop str end))) - (if-let (val (get-text-property pos prop str)) - (when (and (eq prop 'display) (stringp val)) - (push val chunks)) - (push (substring str pos next) chunks)) + (let ((next (next-single-property-change pos prop str end)) + (val (get-text-property pos prop str))) + (cond + ((and val (eq prop 'display) (stringp val)) + (push val chunks)) + ((not (and val (eq prop 'invisible))) + (push (substring str pos next) chunks))) (setq pos next))) (apply #'concat (nreverse chunks))))