-
Notifications
You must be signed in to change notification settings - Fork 0
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
Vim Session Support #7
Comments
Probably! I haven't used it with sessions, so have no clue what happens at the moment. |
Ideally what we'd be able to do is to open a drawer with nvim-tree, then save the session, then have it open up in the same state again upon session load. |
Agreed, that would be ideal! Unfortunately, at first glance, I'm not sure it's possible with just nvim-drawer alone, or how well it will all work.
You could override An example of overriding local nvim_tree_drawer = create_drawer(...)
local original_does_own_window = nvim_tree_drawer.does_own_window
function nvim_tree_drawer.does_own_window(winid)
local bufname = vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(winid))
return original_does_own_window(winid) or (string.match(bufname, '^NvimTree_') ~= nil)
end
local original_does_own_buffer = nvim_tree_drawer.does_own_buffer
function nvim_tree_drawer.does_own_buffer(bufnr)
local bufname = vim.api.nvim_buf_get_name(bufnr)
return original_does_own_buffer(bufnr) or (string.match(bufname, '^NvimTree_') ~= nil)
end But you'd have to suss around which callbacks to actually use, as I don't think Similar could be done with terminals, replacing |
ok thanks for the explanation, will try playing around with it. |
I'm not sure it helps a lot with sessions, but I ended up making it easier for people to supply their own logic for And supplying only |
How well does this plugin interact with vim session files? E.g., if I create an nvim-tree in a drawer and then save the session, will it re-open to any extent when reloading the session? Is there anything special that needs to be done with the nvim-drawer API to make it work (or work better) with sessions?
The text was updated successfully, but these errors were encountered: