-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for opening buffer in the active preview window in the background as a normal buffer #8
Comments
hey @sahilsehwag there's some support for this with regular Vim window movements. That said there are some UI issues that happen when you do that currently since the borders are not removed. I can probably fix the UI issues in the plugin though. Another thing to note is that the plugin still keeps track of that window, so if you trigger the binding to close all the windows, that window you just moved to a split would also close. Could potentially also be tweaked but I'd like to put more thought into what would be a desired workflow first. |
Hey, this satisfies one of the flow, another flow that would be great to have is(I am not sure if vim supports it), open the buffer in background without losing/closing the current preview window(s) ? The main usecase for the second flow is that, sometimes we want to keep digging into definitions, and along the way, we might find some definitions that we want analyse further, but we also don't want to lose the current location of preview window, so the thought process for the second flow is, Does this makes sense? or does this sounds feasible? |
I see, you could add mappings to do I think this would be possible to support in goto-preview as part of the default mappings, those assume a particular flow ofc, but if you're opting into using default mappings, that's probably okay/expected. |
Hey. So one way you could make this happen is adding your own mapping in the |
Closing this as it is technically supported and really just depends on how one wants to use do it. |
@rmagatti i tried with :badd to add current floating window to buffer list, but i don't see any new added buffer in buffer list. (:buffers)
also, an example would be grateful for
|
@shaeinst ah right, I think I was wrong before, instead of post_open_hook = function()
vim.api.nvim_buf_set_option(vim.api.nvim_get_current_buf(), "buflisted")
end |
thanks.
so following would work post_open_hook = function()
-- add preview window to buffer list
local buffer_num = vim.api.nvim_get_current_buf() -- current buffer
vim.api.nvim_buf_set_option(buffer_num, "buflisted", true)
end;
|
Sometimes we are navigating the code and while digging some definitions we find some important symbol that we need to understand more carefully(like it keeping it aside and thinking something like I'll come back to this).
It would be better if we can have support to open the buffer in active preview window to a normal buffer (without loosing the focus of floating preview)
The text was updated successfully, but these errors were encountered: