Skip to content

Commit

Permalink
vertico--flatten-string: Handle display space properties correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed May 19, 2021
1 parent cc23578 commit 030b964
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions vertico.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))))

Expand Down

0 comments on commit 030b964

Please sign in to comment.