summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2021-06-08 08:53:29 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2021-06-08 08:53:29 +0900
commit7191ebb615f5d6ebbf51d598d8ec853a65e2274d (patch)
tree02f86c0f58eec8e9aa052c739f44c2f4b29d1c1e
parenta74731d7f5abe874fb14766249a039408f2137b5 (diff)
Do not show preview window by default if `--preview` is empty
Close #2516
-rw-r--r--CHANGELOG.md16
-rw-r--r--src/terminal.go3
2 files changed, 18 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 06fe7d8f..fd49e20e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,22 @@
CHANGELOG
=========
+0.27.3
+------
+- Preview window is `hidden` by default when there are `preview` bindings but
+ `--preview` command is not given
+- Vim plugin
+ - `sinklist` is added as a synonym to `sink*` so that it's easier to add
+ a function to a spec dictionary
+ ```vim
+ let spec = { 'source': 'ls', 'options': ['--multi', '--preview', 'cat {}'] }
+ function spec.sinklist(matches)
+ echom string(a:matches)
+ endfunction
+
+ call fzf#run(fzf#wrap(spec))
+ ```
+
0.27.2
------
- 16 base ANSI colors can be specified by their names
diff --git a/src/terminal.go b/src/terminal.go
index d393b610..4774e145 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -425,6 +425,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
delay = initialDelay
}
var previewBox *util.EventBox
+ showPreviewWindow := len(opts.Preview.command) > 0 && !opts.Preview.hidden
if len(opts.Preview.command) > 0 || hasPreviewAction(opts) {
previewBox = util.NewEventBox()
}
@@ -521,7 +522,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
selected: make(map[int32]selectedItem),
reqBox: util.NewEventBox(),
previewOpts: opts.Preview,
- previewer: previewer{0, []string{}, 0, previewBox != nil && !opts.Preview.hidden, false, true, false, ""},
+ previewer: previewer{0, []string{}, 0, showPreviewWindow, false, true, false, ""},
previewed: previewed{0, 0, 0, false},
previewBox: previewBox,
eventBox: eventBox,