Skip to content
Myr

Kill preview process when hiding the preview window

Before adoption: this commit came in with the history the project adopted, so no landing records it.

via toggle-preview, hide-preview, or change-preview-window

authored by Junegunn Choi · committed by Junegunn Choi · parent eec557b · Browse files · 1 file+11 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−1 removed

  • other:+11 added−1 removed

1 file+11 added−1 removed

modified:src/terminal.go+11 added-1 removed
3380 unmodified lines
3381 } else {3382 // Discard the preview content so that it won't accidentally appear3383 // when preview window is re-enabled and previewDelay is triggered3384 t.previewer.lines = nil33853386 // Also kill the preview process if it's still running3387 t.cancelPreview()3388 }3389 }3390 case actTogglePreviewWrap:3391 if t.hasPreviewWindow() {
598 unmodified lines
3990 }39913992 // Full redraw3993 if !currentPreviewOpts.sameLayout(t.previewOpts) {3991 wasHidden := t.pwindow == nil3994 // Preview command can be running in the background if the size of3995 // the preview window is 0 but not 'hidden'3996 wasHidden := currentPreviewOpts.hidden3997 updatePreviewWindow(false)3998 if wasHidden && t.hasPreviewWindow() {3999 // Restart4000 refreshPreview(t.previewOpts.command)4001 } else if t.previewOpts.hidden {4002 // Cancel4003 t.cancelPreview()4004 } else {4005 // Refresh4006 req(reqPreviewRefresh)4007 }4008 } else if !currentPreviewOpts.sameContentLayout(t.previewOpts) {4009 t.previewed.version = 0
208 unmodified lines