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

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

[elpa] externals/vertico 63c5356: Add vertico-flat-max-lines (Fix #99)


From: ELPA Syncer
Subject: [elpa] externals/vertico 63c5356: Add vertico-flat-max-lines (Fix #99)
Date: Thu, 5 Aug 2021 04:57:16 -0400 (EDT)

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

    Add vertico-flat-max-lines (Fix #99)
---
 extensions/vertico-flat.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/extensions/vertico-flat.el b/extensions/vertico-flat.el
index 6a1bf81..41c6155 100644
--- a/extensions/vertico-flat.el
+++ b/extensions/vertico-flat.el
@@ -32,6 +32,11 @@
 
 (require 'vertico)
 
+(defcustom vertico-flat-max-lines 1
+  "Maximal number of lines to use."
+  :type 'integer
+  :group 'vertico)
+
 (defcustom vertico-flat-format
   '(:left      #("{" 0 1 (face minibuffer-prompt))
     :separator #(" | " 0 3 (face minibuffer-prompt))
@@ -44,6 +49,7 @@
 
 (defun vertico-flat--display (candidates)
   "Display CANDIDATES horizontally."
+  (setq-local truncate-lines nil)
   (move-overlay vertico--candidates-ov (point-max) (point-max))
   (overlay-put
    vertico--candidates-ov 'after-string
@@ -58,7 +64,7 @@
   "Arrange candidates."
   (let* ((index (max 0 vertico--index)) (count vertico-count)
          (candidates (nthcdr vertico--index vertico--candidates))
-         (width (- (window-width) 4
+         (width (- (* vertico-flat-max-lines (- (window-width) 4))
                    (length (plist-get vertico-flat-format :left))
                    (length (plist-get vertico-flat-format :separator))
                    (length (plist-get vertico-flat-format :right))



reply via email to

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