Run preview command when preview window appears after resize (#3113)

# Start fzf in a small screen so that the preview window is hidden
  fzf --bind 'ctrl-p:toggle-preview' --preview 'stat {}' --preview-window='right,50%,<100(down,50%,hidden)'

  # Enlarge the screen until the preview window appears. It should not be empty.
This commit is contained in:
Junegunn Choi
2023-01-07 16:06:18 +09:00
parent bf641faafa
commit 80b8846318

View File

@@ -2622,7 +2622,11 @@ func (t *Terminal) Loop() {
t.tui.Resume(t.fullscreen, t.sigstop)
t.redraw()
case reqFullRedraw:
wasHidden := t.pwindow == nil
t.redraw()
if wasHidden && t.pwindow != nil {
refreshPreview(t.previewOpts.command)
}
case reqClose:
exit(func() int {
if t.output() {