Closed emmanueltouzery closed 1 year ago
You can now pass handle_foreign_buffer = function() end
to stickybuf.pin
and that will do what you want. I also added the ability for get_auto_pin
to return a table, which will then be passed in as options to stickybuf.pin
. So you can return the table with that value from get_auto_pin
works great, thank you!!
I was trying to set up stickybuf in my config for diffview https://github.com/sindrets/diffview.nvim
Diffview takes over a whole tab, and it wouldn't make sense to replace any buffer in any of its windows.
This is nice:
However I then hit this code from stickybuf:
and a new window is opened in the diffview tab.
I would ideally like a way to dynamically say "in case X and Y, if no window is available, don't open a split window". I guess it would be possible to have that as a global setting (never open new windows), but maybe it'll be needed to make a dynamic decision for that. Maybe
get_auto_pin
could return instead of true/false,"pin_with_fallback"
or"pin_without_fallback"
, or maybe it could be possible to pass a new function in the options, something likeopen_buffer_in_newsplit = function(bufnr) ... end
...