diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2021-04-17 22:58:05 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2021-04-17 22:58:05 +0200 |
| commit | 59263bf7bc4e85651f31d893c3750375aefcad64 (patch) | |
| tree | bc09e75a0ef9205afac5851a862f1312a38f3de3 | |
| parent | 4c2d5de68352b9e1957b78768727fb72847c40ff (diff) | |
Hide scrollbar if there are fewer than corfu-count candidates
| -rw-r--r-- | corfu.el | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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 |
