diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2025-04-15 08:10:08 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2025-04-15 08:10:08 +0200 |
| commit | 5834e3ed652068209a653ea067f91d3f537d0be5 (patch) | |
| tree | bca725286b72fdde1c535278a85932b632a28d81 | |
| parent | 62709792cb17d679ad0f10d1246fe30f401cffac (diff) | |
Improve lazy highlighting for quoted candidates (bug#77754)
| -rw-r--r-- | corfu.el | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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))) |
