mirror of
https://github.com/junegunn/fzf.git
synced 2026-05-19 23:10:06 +08:00
Fix adaptive height calculation to exclude header lines
The adaptive height (--height ~100%) was using the raw chunklist count including header items, making the window too tall by headerLines rows.
This commit is contained in:
+3
-2
@@ -323,10 +323,11 @@ func Run(opts *Options) (int, error) {
|
|||||||
query := []rune{}
|
query := []rune{}
|
||||||
determine := func(final bool) {
|
determine := func(final bool) {
|
||||||
if heightUnknown {
|
if heightUnknown {
|
||||||
if total >= maxFit || final {
|
items := max(0, total-int(headerLines))
|
||||||
|
if items >= maxFit || final {
|
||||||
deferred = false
|
deferred = false
|
||||||
heightUnknown = false
|
heightUnknown = false
|
||||||
terminal.startChan <- fitpad{min(total, maxFit), padHeight}
|
terminal.startChan <- fitpad{min(items, maxFit), padHeight}
|
||||||
}
|
}
|
||||||
} else if deferred {
|
} else if deferred {
|
||||||
deferred = false
|
deferred = false
|
||||||
|
|||||||
Reference in New Issue
Block a user