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

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

[elpa] externals/vertico 486d426 2/7: Pass lines to `vertico--display-ca


From: Protesilaos Stavrou
Subject: [elpa] externals/vertico 486d426 2/7: Pass lines to `vertico--display-candidates`
Date: Sat, 10 Apr 2021 15:17:17 -0400 (EDT)

branch: externals/vertico
commit 486d4263124473f35700f9f66f7ffc0cddb5f073
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Pass lines to `vertico--display-candidates`
    
    This gives a bit more flexibility for resizing and in case one wants to
    overwrite `vertico--display-candidates` with an alternative display action,
    showing the candidates in a buffer for example.
---
 vertico.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/vertico.el b/vertico.el
index d5ce707..3ec6d3e 100644
--- a/vertico.el
+++ b/vertico.el
@@ -356,15 +356,15 @@
         (setcdr (nthcdr (- vertico-count 1) lines) nil)))
     (when lines
       (setcar lines (substring (car lines) 0 -1)))
-    (apply #'concat
-           (and (eobp) #(" " 0 1 (cursor t)))
-           (and lines "\n")
-           (nreverse lines))))
+    (nreverse lines)))
 
-(defun vertico--display-candidates (str)
-  "Update candidates overlay `vertico--candidates-ov' with STR."
+(defun vertico--display-candidates (lines)
+  "Update candidates overlay `vertico--candidates-ov' with LINES."
   (move-overlay vertico--candidates-ov (point-max) (point-max))
-  (overlay-put vertico--candidates-ov 'after-string str))
+  (overlay-put vertico--candidates-ov 'after-string
+               (apply #'concat
+                      (and (eobp) #(" " 0 1 (cursor t)))
+                      (and lines "\n") lines)))
 
 (defun vertico--display-count ()
   "Update count overlay `vertico--count-ov'."



reply via email to

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