Skip to content

Commit

Permalink
Create count overlay only when format is non-nil
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Jul 6, 2021
1 parent e30997d commit 0de48f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vertico.el
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ See `resize-mini-windows' for documentation."

(defun vertico--display-count ()
"Update count overlay `vertico--count-ov'."
(when vertico-count-format
(when vertico--count-ov
(move-overlay vertico--count-ov (point-min) (point-min))
(overlay-put vertico--count-ov 'before-string
(format (car vertico-count-format)
Expand Down Expand Up @@ -682,7 +682,8 @@ When the prefix argument is 0, the group order is reset."
"Setup completion UI."
(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))
vertico--count-ov (and vertico-count-format
(make-overlay (point-min) (point-min) nil t t)))
(setq-local resize-mini-windows 'grow-only
max-mini-window-height 1.0
completion-auto-help nil
Expand Down

0 comments on commit 0de48f8

Please sign in to comment.