Open sQVe opened 1 year ago
👋🏼, Glad you like it, and thank you for reporting the issue.
Based on your description, I was able to reproduce the issue. Previously, there was a hard-coded filter for unlisted buffers, which activated the fallback, which per default does nothing.
I have added a new config option (https://github.com/ghillb/cybu.nvim/commit/e74c3fa74e521f2b347f9f70f7c56c5db0abec56) that allows you to turn off the filter for unlisted buffers. By setting filter = { unlisted = false }
in your config, Cybu will no longer stop working when cycling through unlisted buffers. I have plans for further improvements in handling and filtering unlisted buffers, but for now, I hope this new option resolves the issue.
@ghillb Yeah, that fixes the issue of Cybu not working on unlisted buffers. Sadly, this counters the reason I'm using bufignore.nvim
. There is no need to unlist buffers if I'm able to cycle thorough all buffers, including unlisted ones.
One solution, that I'm guessing would be possible, is to add a fallback to the cycle
command. If cycle
fails to run either bnext
or bprevious
, or even better allow the user to supply a fallback.
Could you please test if the fallback setting can handle your use case? I just added the possibility to grab direction
(values: "next"
or "prev"
), and mode
(values: "default"
, "last_used"
or"auto"
) parameters in the fallback (https://github.com/ghillb/cybu.nvim/commit/d15cd01439423ebf676b6d807049738be38d6582). You can find the conditions on when the fallback is called here.
Example:
fallback = function(direction, mode)
if direction == "next" then
vim.cmd("bnext")
else
vim.cmd("bprev")
end
end,
That looks like an awesome solution. It sort of works but there seems to be a bug. I have to run cycle
sometime twice for a unlisted buffer and the Cybu window gets unsynced from the visible buffer. See screenrecording:
https://user-images.githubusercontent.com/2284724/233307605-d40d503d-3f9a-4620-94c6-f079de08eb25.mp4
👋🏼,
First off, I want to say thank you - I'm really loving this plugin!
In my setup, I use
bufignore.nvim
to unlist Git ignored buffers once they are hidden. However, I've encountered an issue with Cybu when I move through the entire list of buffers it provides. When it encounters an unlisted buffer, Cybu silently stops working, and I have to usebnext
to move to another listed buffer.This behavior can be easily replicated with the following steps:
vim.defer.fn
to unlist one of the buffers with a delay of 1-2 seconds.