Problem
Quite often, I find myself launching the fff.nvim picker from a terminal buffer. When I select a file with <CR>, it opens the buffer in anther split that I have open.
I can see how this could be useful to prevent opening files in buffers like the quickfix list.
But more often than not, I actually want it to replace my buffer, even if it's not a "normal" buffer.
i.e., I'll end up with the following situation:
<regular_buffer> | <terminal_buffer>
... |
... | > | <- cursor is here
I want to open a file and replace the terminal buffer.
With the current implementation, I have to:
- Close the terminal buffer
- Create a new split and search the file I want to replace the terminal buffer with
- Or, Search and use the keymap for opening in a vertical split
Neither is intuitive (and it's inconsistent with the behaviour of other pickers, like telescope.nvim).
I have the same issue with other buffers, like oil.nvim buffers (buftype = "acwrite").
Proposed solutions
- Remove the logic altogether
- Or, add a config option to disable it
- Or, maintain a list of buffer types (e.g.
quickfix) that trigger the find_suitable_buffer switching logic.
- Or, maintain a list of suitable buffer types (e.g.
terminal and acwrite)
Relevant code
https://github.com/dmtrKovalenko/fff.nvim/blob/64861f8142c5ce8c34f9ec73a3d084857182e156/lua/fff/picker_ui.lua?plain=1#L2305-L2308
Problem
Quite often, I find myself launching the fff.nvim picker from a terminal buffer. When I select a file with
<CR>, it opens the buffer in anther split that I have open.I can see how this could be useful to prevent opening files in buffers like the quickfix list.
But more often than not, I actually want it to replace my buffer, even if it's not a "normal" buffer.
i.e., I'll end up with the following situation:
I want to open a file and replace the terminal buffer.
With the current implementation, I have to:
Neither is intuitive (and it's inconsistent with the behaviour of other pickers, like telescope.nvim).
I have the same issue with other buffers, like oil.nvim buffers (buftype = "acwrite").
Proposed solutions
quickfix) that trigger thefind_suitable_bufferswitching logic.terminalandacwrite)Relevant code
https://github.com/dmtrKovalenko/fff.nvim/blob/64861f8142c5ce8c34f9ec73a3d084857182e156/lua/fff/picker_ui.lua?plain=1#L2305-L2308