mirror of
https://github.com/junegunn/fzf.git
synced 2026-02-27 12:02:33 +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:
@@ -323,10 +323,11 @@ func Run(opts *Options) (int, error) {
|
||||
query := []rune{}
|
||||
determine := func(final bool) {
|
||||
if heightUnknown {
|
||||
if total >= maxFit || final {
|
||||
items := max(0, total-int(headerLines))
|
||||
if items >= maxFit || final {
|
||||
deferred = false
|
||||
heightUnknown = false
|
||||
terminal.startChan <- fitpad{min(total, maxFit), padHeight}
|
||||
terminal.startChan <- fitpad{min(items, maxFit), padHeight}
|
||||
}
|
||||
} else if deferred {
|
||||
deferred = false
|
||||
|
||||
Reference in New Issue
Block a user