emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu 5214170 6/6: Add base string when previewing the


From: Protesilaos Stavrou
Subject: [elpa] externals/corfu 5214170 6/6: Add base string when previewing the current candidate
Date: Sat, 17 Apr 2021 18:26:56 -0400 (EDT)

branch: externals/corfu
commit 5214170fd416efe395cbeb33d4fc4391189070c3
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Add base string when previewing the current candidate
---
 corfu.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/corfu.el b/corfu.el
index 4c623ae..e28831a 100644
--- a/corfu.el
+++ b/corfu.el
@@ -394,7 +394,7 @@ If `line-spacing/=nil' or in text-mode, the background 
color is used instead.")
            (not (and (= (car bounds) (length str)) (test-completion str table 
pred)))
            ;; XXX Completion is terminated if there are no matches. Add 
optional confirmation?
            corfu--candidates
-           ;; Single candidate
+           ;; Single candidate, which matches input exactly
            (not (equal corfu--candidates (list str))))
       (let* ((start (min (max 0 (- corfu--index (/ corfu-count 2)))
                          (max 0 (- corfu--total corfu-count))))
@@ -408,7 +408,7 @@ If `line-spacing/=nil' or in text-mode, the background 
color is used instead.")
           (let ((ov (make-overlay beg end nil t t)))
             (overlay-put ov 'priority 1000)
             (overlay-put ov 'window (selected-window))
-            (overlay-put ov 'display (nth curr cands))
+            (overlay-put ov 'display (concat (substring str 0 corfu--base) 
(nth curr cands)))
             (push ov corfu--overlays)))
         ;; Nonlinearity at the end and the beginning
         (when (/= start 0)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]