linrongbin16/fzfx.nvim

Support resizing fzfx popup window when Neovim is resized

jetm opened this issue ยท 7 comments

jetm commented

The fzfx live_grep feature works very well. I have tested several live_grep implementations under Telescope, and I found fzfx to be better. I can easily change the search query. Thanks you!

Do you plan to add resize query result support when Neovim is maximized?

The case is using Neovim under Tmux in one pane. When the pane is maximized, Neovim width is expanded too, but the fzfx live_grep results are not.

Hi @jetm , support tmux should be good, would you please help me define some details (since I'm not expert on tmux)?

  1. You start a maximized terminal, and start a tmux pane and split the terminal into two parts (vertical or horizontal), and even split terminal into multiple small parts.
  2. In one of the tmux pane, you start running neovim, and inside it you start fzfx to do live grep.
  3. And when you make the tmux (the one running neovim) maximized or resize the tmux pane to bigger/smaller, the fzfx popup window height/width remains all the same (the initial window size).

Is that correct?

If so, I can make fzfx popup window dynamically calculate the window size every time it starts, so every time you resize the tmux panel window, it should be fit your tmux pane.

Oh, I think I got your point, you mean when a popup window is already opened, and tmux pane is resizing (or a terminal window that running neovim is resizing), the fzfx popup window will re-calculating the popup window size and do resizing while the neovim window is resizing!

I think I could listen to the Neovim Editor/Window changed event, and do resize.

jetm commented

Is that correct?

Yes, that's correct

jetm commented

a terminal window that running neovim is resized

Yes, a terminal window is a commoner case than using tmux.

I believe this is how Telescope does the resizing: nvim-telescope/telescope.nvim@adfbd61. But I don't know how to replicate the same work on fzfx

thanks, the architecture is quite different between fzf-based plugin and telescope.

I will try to implement it in my next feature PR.

Hi @jetm , I add realtime resize popup window feature in #322 , would you please pull latest main branch and try?

jetm commented

@linrongbin16 That was fast! It works nicely. Tested on Linux with Kitty, Tmux, and Neovim. Thank you so much!

From my perspective, this is solved. You might want to close it. Thanks.