Skip to content
Myr

Do not show preview window by default if `--preview` is empty

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

Close #2516

authored by Junegunn Choi · committed by Junegunn Choi · parent a74731d · Browse files · 2 files+18 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

2 files+18 added−1 removed

  • other:+18 added−1 removed

2 files+18 added−1 removed

modified:src/terminal.go+2 added-1 removed
423 unmodified lines
424 } else {425 delay = initialDelay426 }427 var previewBox *util.EventBox428 showPreviewWindow := len(opts.Preview.command) > 0 && !opts.Preview.hidden429 if len(opts.Preview.command) > 0 || hasPreviewAction(opts) {430 previewBox = util.NewEventBox()431 }432 strongAttr := tui.Bold
88 unmodified lines
521 merger: EmptyMerger,522 selected: make(map[int32]selectedItem),523 reqBox: util.NewEventBox(),524 previewOpts: opts.Preview,524 previewer: previewer{0, []string{}, 0, previewBox != nil && !opts.Preview.hidden, false, true, false, ""},525 previewer: previewer{0, []string{}, 0, showPreviewWindow, false, true, false, ""},526 previewed: previewed{0, 0, 0, false},527 previewBox: previewBox,528 eventBox: eventBox,529 mutex: sync.Mutex{},
2243 unmodified lines
modified:CHANGELOG.md+16 added
1CHANGELOG2=========340.27.35------6- Preview window is `hidden` by default when there are `preview` bindings but7 `--preview` command is not given8- Vim plugin9 - `sinklist` is added as a synonym to `sink*` so that it's easier to add10 a function to a spec dictionary11 ```vim12 let spec = { 'source': 'ls', 'options': ['--multi', '--preview', 'cat {}'] }13 function spec.sinklist(matches)14 echom string(a:matches)15 endfunction1617 call fzf#run(fzf#wrap(spec))18 ```19200.27.221------22- 16 base ANSI colors can be specified by their names23 ```sh
1149 unmodified lines