Fix maximum preview height without horizontal separator

The minimum window height decreases when no extra line for the
horizontal separator is used (e.g. with `--info=inline --no-separator`).
In this case the preview window should be able to occupy this extra
line.
This commit is contained in:
Julian Prein 2024-11-09 19:26:17 +01:00 committed by Junegunn Choi
parent e4e4700aff
commit 19e9b620ba

View File

@ -1648,7 +1648,11 @@ func (t *Terminal) resizeWindows(forcePreview bool) {
}
switch previewOpts.position {
case posUp, posDown:
pheight := calculateSize(height, previewOpts.size, minHeight, minPreviewHeight, verticalPad)
minWindowHeight := minHeight
if t.noSeparatorLine() {
minWindowHeight--
}
pheight := calculateSize(height, previewOpts.size, minWindowHeight, minPreviewHeight, verticalPad)
if hasThreshold && pheight < previewOpts.threshold {
t.activePreviewOpts = previewOpts.alternative
if forcePreview {