[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vertico 53da8b8 3/7: Truncate lines and resize manually
From: |
Protesilaos Stavrou |
Subject: |
[elpa] externals/vertico 53da8b8 3/7: Truncate lines and resize manually (Fix #5) |
Date: |
Sat, 10 Apr 2021 15:17:17 -0400 (EDT) |
branch: externals/vertico
commit 53da8b872adeecd1bc302d8c498b03ed4a8dc869
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Truncate lines and resize manually (Fix #5)
The setting of `resize-mini-windows' is respected.
---
vertico.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/vertico.el b/vertico.el
index 3ec6d3e..c52117c 100644
--- a/vertico.el
+++ b/vertico.el
@@ -364,7 +364,10 @@
(overlay-put vertico--candidates-ov 'after-string
(apply #'concat
(and (eobp) #(" " 0 1 (cursor t)))
- (and lines "\n") lines)))
+ (and lines "\n") lines))
+ (let ((delta (- (length lines) (window-height) -1)))
+ (when (or (> delta 0) (eq (default-value 'resize-mini-windows) t))
+ (window-resize nil delta))))
(defun vertico--display-count ()
"Update count overlay `vertico--count-ov'."
@@ -421,9 +424,9 @@
(t (cons 0 (length after)))))))
(unless (equal vertico--input (cons content pt))
(vertico--update-candidates pt content bounds metadata))
- (vertico--display-candidates (vertico--format-candidates content bounds
metadata))
+ (vertico--prompt-selection)
(vertico--display-count)
- (vertico--prompt-selection)))
+ (vertico--display-candidates (vertico--format-candidates content bounds
metadata))))
(defun vertico--require-match ()
"Return t if match is required."
@@ -514,9 +517,9 @@
(setq vertico--input t
vertico--candidates-ov (make-overlay (point-max) (point-max) nil t t)
vertico--count-ov (make-overlay (point-min) (point-min) nil t t))
- (setq-local resize-mini-windows (or resize-mini-windows 'grow-only) ;; Must
be non-nil
- orderless-skip-highlighting t ;; Orderless optimization
- truncate-lines nil
+ (setq-local orderless-skip-highlighting t ;; Orderless optimization
+ resize-mini-windows 'grow-only
+ truncate-lines t
max-mini-window-height 1.0)
(use-local-map vertico-map)
(add-hook 'post-command-hook #'vertico--exhibit -99 'local))
- [elpa] externals/vertico updated (5aaa5f6 -> 424a7e0), Protesilaos Stavrou, 2021/04/10
- [elpa] externals/vertico 48472e9 1/7: README: Mention the copyright assignment, Protesilaos Stavrou, 2021/04/10
- [elpa] externals/vertico 53da8b8 3/7: Truncate lines and resize manually (Fix #5),
Protesilaos Stavrou <=
- [elpa] externals/vertico 81b3e3b 4/7: Respect `resize-mini-windows' set to nil, Protesilaos Stavrou, 2021/04/10
- [elpa] externals/vertico 424a7e0 7/7: README: Fix invalid keybindings, Protesilaos Stavrou, 2021/04/10
- [elpa] externals/vertico 412a656 6/7: Always add cursor space to the overlay, Protesilaos Stavrou, 2021/04/10
- [elpa] externals/vertico 486d426 2/7: Pass lines to `vertico--display-candidates`, Protesilaos Stavrou, 2021/04/10
- [elpa] externals/vertico 4198389 5/7: vertico--prompt-selection: Preserve existing faces, Protesilaos Stavrou, 2021/04/10