mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-10 17:51:58 -07:00
Do not show preview window by default if --preview
is empty
Close #2516
This commit is contained in:
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,6 +1,22 @@
|
|||||||
CHANGELOG
|
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
|
0.27.2
|
||||||
------
|
------
|
||||||
- 16 base ANSI colors can be specified by their names
|
- 16 base ANSI colors can be specified by their names
|
||||||
|
@@ -425,6 +425,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
|
|||||||
delay = initialDelay
|
delay = initialDelay
|
||||||
}
|
}
|
||||||
var previewBox *util.EventBox
|
var previewBox *util.EventBox
|
||||||
|
showPreviewWindow := len(opts.Preview.command) > 0 && !opts.Preview.hidden
|
||||||
if len(opts.Preview.command) > 0 || hasPreviewAction(opts) {
|
if len(opts.Preview.command) > 0 || hasPreviewAction(opts) {
|
||||||
previewBox = util.NewEventBox()
|
previewBox = util.NewEventBox()
|
||||||
}
|
}
|
||||||
@@ -521,7 +522,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
|
|||||||
selected: make(map[int32]selectedItem),
|
selected: make(map[int32]selectedItem),
|
||||||
reqBox: util.NewEventBox(),
|
reqBox: util.NewEventBox(),
|
||||||
previewOpts: opts.Preview,
|
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},
|
previewed: previewed{0, 0, 0, false},
|
||||||
previewBox: previewBox,
|
previewBox: previewBox,
|
||||||
eventBox: eventBox,
|
eventBox: eventBox,
|
||||||
|
Reference in New Issue
Block a user