linrongbin16/fzfx.nvim

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

This could be duplicated from #603, and also fixed by #609.

I will take a look later.


hi @damanis, you could set let g:fzfx_disable_buffer_previewer=1 to disable the new feature as a workaround.

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:

image

However in the subsequent versions --height is ignored:

image

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.

hi @damanis , I add 'top' and 'bottom' options in #612 , please pull main branch and try again!

@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% 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)?

  1. the preview window size options 75%/50% should work, let me check again.
  2. to adjust fzfx popup window size, please customize popup.win_opts in setup, please check:
    popup = {

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.

image