Fix bug where top section of the previous preview content appearing

when the preview window is re-enabled and the current preview process is
taking more than 500ms and previewDelayed is triggered

  fzf --preview 'sleep 1; date; seq 1000' --bind space:toggle-preview
This commit is contained in:
Junegunn Choi
2023-10-21 16:11:15 +09:00
parent 690d5e6dbd
commit f5e4ee90e4

View File

@@ -3100,6 +3100,10 @@ func (t *Terminal) Loop() {
t.previewBox.Set(reqPreviewEnqueue,
previewRequest{t.previewOpts.command, t.pwindow, t.evaluateScrollOffset(), list})
}
} else {
// Discard the preview content so that it won't accidentally appear
// when preview window is re-enabled and previewDelay is triggered
t.previewer.lines = nil
}
}
case actTogglePreviewWrap: