Skip to content

Commit

Permalink
Adjust minimum sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Jan 29, 2025
1 parent 8da6412 commit 8c60867
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1129,9 +1129,15 @@ func (t *Terminal) visibleHeaderLinesInList() int {

// Extra number of lines needed to display fzf
func (t *Terminal) extraLines() int {
extra := 1
if t.inputBorderShape.Visible() {
extra += borderLines(t.inputBorderShape)
extra := 0
if !t.inputless {
extra++
if !t.noSeparatorLine() {
extra++
}
if t.inputBorderShape.Visible() {
extra += borderLines(t.inputBorderShape)
}
}
if t.listBorderShape.Visible() {
extra += borderLines(t.listBorderShape)
Expand All @@ -1146,9 +1152,6 @@ func (t *Terminal) extraLines() int {
}
extra += t.headerLines
}
if !t.noSeparatorLine() {
extra++
}
return extra
}

Expand Down Expand Up @@ -1640,8 +1643,11 @@ func (t *Terminal) adjustMarginAndPadding() (int, int, [4]int, [4]int) {

minAreaWidth := minWidth
minAreaHeight := minHeight
if t.inputless {
minAreaHeight--
}
if t.noSeparatorLine() {
minAreaHeight -= 1
minAreaHeight--
}
if t.needPreviewWindow() {
minPreviewWidth, minPreviewHeight := t.minPreviewSize(t.activePreviewOpts)
Expand Down Expand Up @@ -1878,6 +1884,9 @@ func (t *Terminal) resizeWindows(forcePreview bool, redrawBorder bool) {
switch previewOpts.position {
case posUp, posDown:
minWindowHeight := minHeight
if t.inputless {
minWindowHeight--
}
if t.noSeparatorLine() {
minWindowHeight--
}
Expand Down

0 comments on commit 8c60867

Please sign in to comment.