Impossible configure preview window
damanis opened this issue · 7 comments
In v5.4.2 it is impossible to override preview-window to top for buffers
and files
.
The configuration (in buffers
and files
preview always shown on right, live_grep
shown on top):
local fzfx = require("fzfx")
fzfx.setup({
override_fzf_opts = {
{ "--preview-window", "top,75%" },
},
buffers = {
fzf_opts = {
{ "--prompt", "Buffers > " },
{ "--delimiter", ":" },
{ "--preview-window", "top,75%,+{2}-/2" },
},
},
files = {
fzf_opts = {
{ "--prompt", "Files > " },
{ "--delimiter", ":" },
{ "--preview-window", "top,50%,+{2}-/2" },
},
},
})
FZFX version: v5.4.2
and also fixed by #609.
As far as I can tell, this isn't quite fixed yet. fzf_opts
are also affected, for example running v5.1.6 with
fzf_opts = {
'--no-separator',
'--ansi',
'--info=inline',
'--layout=reverse',
'--preview-window=hidden',
'--border=sharp',
'--height=100%',
'--bind=ctrl-e:toggle',
'--bind=ctrl-a:toggle-all',
'--bind=ctrl-w:toggle-preview',
},
results in the window correctly set to the full height of the nVim parent frame:
However in the subsequent versions --height
is ignored:
I think I know the root cause, @damanis , for now you can use up
and down
instead of top
and bottom
.
I will add top
and bottom
later.
@linrongbin16
Confirm, top
works.
But size of preview panel (75%
and 50%
in configuration above) are ignored. Is the way to set them?
P.S. Also, is there are options to configure Fzfx popup window size (e.g., 90% of the main window)?
@linrongbin16 Confirm,
top
works. But size of preview panel (75%
and50%
in configuration above) are ignored. Is the way to set them? P.S. Also, is there are options to configure Fzfx popup window size (e.g., 90% of the main window)?
- the preview window size options
75%
/50%
should work, let me check again. - to adjust fzfx popup window size, please customize
popup.win_opts
in setup, please check:Line 233 in a16f1ab
confirmed the 75%
/50%
options is not working, I will fix it again.
hi @damanis , I take a look again, with the config you're using:
require("fzfx").setup({
override_fzf_opts = {
{ "--preview-window", "top,75%" },
},
buffers = {
fzf_opts = {
{ "--prompt", "Buffers > " },
{ "--delimiter", ":" },
{ "--preview-window", "top,75%,+{2}-/2" },
},
},
files = {
fzf_opts = {
{ "--prompt", "Files > " },
{ "--delimiter", ":" },
{ "--preview-window", "top,50%,+{2}-/2" },
},
},
})
The override_fzf_opts
is force all popup (both files
and buffers
) using --preview-window
= top,75%
.
So you need to remove override_fzf_opts
.