branch: externals/corfu commit 5834e3ed652068209a653ea067f91d3f537d0be5 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Improve lazy highlighting for quoted candidates (bug#77754) --- corfu.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/corfu.el b/corfu.el index b9ab640235..b9b8b7d37b 100644 --- a/corfu.el +++ b/corfu.el @@ -777,10 +777,14 @@ FRAME is the existing frame." (pcase-let* ((last (min (+ corfu--scroll corfu-count) corfu--total)) (bar (ceiling (* corfu-count corfu-count) corfu--total)) (lo (min (- corfu-count bar 1) (floor (* corfu-count corfu--scroll) corfu--total))) - (`(,mf . ,acands) (corfu--affixate - (cl-loop repeat corfu-count - for c in (nthcdr corfu--scroll corfu--candidates) - collect (funcall corfu--hilit (substring c))))) + (`(,mf . ,acands) + (corfu--affixate + (cl-loop + repeat corfu-count for c in (nthcdr corfu--scroll corfu--candidates) + collect (funcall corfu--hilit + ;; bug#77754: Highlight unquoted string. + (substring (or (get-text-property + 0 'completion--unquoted c) c)))))) (`(,pw ,width ,fcands) (corfu--format-candidates acands)) ;; Disable the left margin if a margin formatter is active. (corfu-left-margin-width (if mf 0 corfu-left-margin-width)))