Fix scrollability of the preview window when preview offset is specified

This should not be scrollable

  fzf --preview 'seq $FZF_PREVIEW_LINES' --preview-window '~5'
This commit is contained in:
Junegunn Choi 2023-10-20 17:37:08 +09:00
parent a76c055b63
commit 690d5e6dbd
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -2081,7 +2081,7 @@ func (t *Terminal) printPreview() {
unchanged := (t.previewed.filled || numLines == t.previewed.numLines) &&
t.previewer.version == t.previewed.version &&
t.previewer.offset == t.previewed.offset
t.previewer.scrollable = t.previewer.offset > 0 || numLines > height
t.previewer.scrollable = t.previewer.offset > t.previewOpts.headerLines || numLines > height
t.renderPreviewArea(unchanged)
t.renderPreviewSpinner()
t.previewed.numLines = numLines