dmtrKovalenko / dmtrKovalenko/fff
[Discussion] unintuitive `find_suitable_window` logic for `edit` actions
- Dominant language
- Rust
- Stars
- 10.7k
- Forks
- 446
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 39
Description
## Problem
Quite often, I find myself launching the fff.nvim picker from a terminal buffer. When I select a file with ``, 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:
```
|
... |
... | > | <- 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
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.