summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2021-04-17 22:58:05 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2021-04-17 22:58:05 +0200
commit59263bf7bc4e85651f31d893c3750375aefcad64 (patch)
treebc09e75a0ef9205afac5851a862f1312a38f3de3
parent4c2d5de68352b9e1957b78768727fb72847c40ff (diff)
Hide scrollbar if there are fewer than corfu-count candidates
-rw-r--r--corfu.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/corfu.el b/corfu.el
index fc1fe29..4c623ae 100644
--- a/corfu.el
+++ b/corfu.el
@@ -216,12 +216,13 @@ If `line-spacing/=nil' or in text-mode, the background color is used instead.")
(if fancy (if (= row idx) lborder-curr lborder) " ")
line
(make-string (- width (string-width line)) 32)
- (if fancy
- (if (and lo (<= lo row (+ lo bar)))
- (if (= row idx) rbar-curr rbar)
- (if (= row idx) rborder-curr rborder))
- (propertize " " 'face (if (and lo (<= lo row (+ lo bar)))
- 'corfu-bar 'corfu-border))))))
+ (cond
+ (fancy (if (and lo (<= lo row (+ lo bar)))
+ (if (= row idx) rbar-curr rbar)
+ (if (= row idx) rborder-curr rborder)))
+ (lo (propertize " " 'face (if (<= lo row (+ lo bar))
+ 'corfu-bar 'corfu-border)))
+ (t " ")))))
(add-face-text-property 0 (length str) (if (= row idx) 'corfu-current 'corfu-background) 'append str)
(push (concat
(truncate-string-to-width bufline col 0 32) str