mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-15 06:43:47 -05:00
--preview-window 0,hidden should not execute the preview command
Until `toggle-preview` action is triggered Fix #3149
This commit is contained in:
@@ -1244,6 +1244,8 @@ func (t *Terminal) resizeWindows(forcePreview bool) {
|
||||
}
|
||||
}
|
||||
resizePreviewWindows(&t.previewOpts)
|
||||
} else {
|
||||
t.activePreviewOpts = &t.previewOpts
|
||||
}
|
||||
|
||||
// Without preview window
|
||||
@@ -2279,7 +2281,7 @@ func (t *Terminal) mayNeedPreviewWindow() bool {
|
||||
|
||||
// Check if previewer is currently in action (invisible previewer with size 0 or visible previewer)
|
||||
func (t *Terminal) isPreviewEnabled() bool {
|
||||
return t.hasPreviewer() && t.previewer.enabled && (!t.previewOpts.Visible() || t.pwindow != nil)
|
||||
return t.hasPreviewer() && t.previewer.enabled && (!t.previewOpts.Visible() && !t.previewOpts.hidden || t.pwindow != nil)
|
||||
}
|
||||
|
||||
func (t *Terminal) hasPreviewWindow() bool {
|
||||
@@ -2866,11 +2868,7 @@ func (t *Terminal) Loop() {
|
||||
return false
|
||||
case actTogglePreview:
|
||||
if t.hasPreviewer() {
|
||||
if t.activePreviewOpts != nil {
|
||||
t.activePreviewOpts.Toggle()
|
||||
} else if !t.previewOpts.Visible() {
|
||||
t.previewer.enabled = !t.previewer.enabled
|
||||
}
|
||||
t.activePreviewOpts.Toggle()
|
||||
updatePreviewWindow(false)
|
||||
if t.isPreviewEnabled() {
|
||||
valid, list := t.buildPlusList(t.previewOpts.command, false, false)
|
||||
|
||||
Reference in New Issue
Block a user