Skip to content

Commit 7191ebb

Browse files
committed
Do not show preview window by default if --preview is empty
Close #2516
1 parent a74731d commit 7191ebb

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
CHANGELOG
22
=========
33

4+
0.27.3
5+
------
6+
- Preview window is `hidden` by default when there are `preview` bindings but
7+
`--preview` command is not given
8+
- Vim plugin
9+
- `sinklist` is added as a synonym to `sink*` so that it's easier to add
10+
a function to a spec dictionary
11+
```vim
12+
let spec = { 'source': 'ls', 'options': ['--multi', '--preview', 'cat {}'] }
13+
function spec.sinklist(matches)
14+
echom string(a:matches)
15+
endfunction
16+
17+
call fzf#run(fzf#wrap(spec))
18+
```
19+
420
0.27.2
521
------
622
- 16 base ANSI colors can be specified by their names

src/terminal.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
425425
delay = initialDelay
426426
}
427427
var previewBox *util.EventBox
428+
showPreviewWindow := len(opts.Preview.command) > 0 && !opts.Preview.hidden
428429
if len(opts.Preview.command) > 0 || hasPreviewAction(opts) {
429430
previewBox = util.NewEventBox()
430431
}
@@ -521,7 +522,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
521522
selected: make(map[int32]selectedItem),
522523
reqBox: util.NewEventBox(),
523524
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, ""},
525526
previewed: previewed{0, 0, 0, false},
526527
previewBox: previewBox,
527528
eventBox: eventBox,

0 commit comments

Comments
 (0)