maximize.nvim
maximize.nvim copied to clipboard
[Feature request] Support nvim-dap-ui buffers
Currently the plugin doesn't work with nvim-dap-ui's elements (like the buffer of the watchers for example). It doesn't even restore them if you toggle maximize the source code buffer. I think it might be because nvim-dap-ui buffers are hidden or something, not sure what they're called; basically they're not visible in the list when you run the command :buffers
I'll try and figure out a fix for this!
There seems to be a general issue with "special windows": nvim-tree, quickfix/location list, help, etc. When you try to maximize those, they disappear and the last "real" (file/buffer) window gets maximized.
I can live without maximizing those special windows, every now and then I forget, and they I lose those windows. So it would be nice to detect them and just do nothing.
I tried to investigate a bit, but I didn't come that far (I basically have zero experience with nvim plugin development).
Still, what I found out:
- closing of non-file buffers happens here: https://github.com/Shatur/neovim-session-manager/blob/9652b392805dfd497877342e54c5a71be7907daf/lua/session_manager/utils.lua#L74-L79
- just commenting the loop out does indeed lead to weird behavior:
- you can maximize utility windows then, but:
- on restore they are just empty (I tested with
nvim-tree
)
- curiously the the comment above the loop mentions a session manager, so I tested with the session manager that I use (possession.nvim)
-
possession.nvim
kind of can restore sessions with utility windows:-
nvim-tree
works just fine, it gets its correct position and contents - quickfix list, or LSP diagnostics with e.g. Trouble get restored, but get a default window size, and have not content (no content makes a lot of sense, as those would need to be re-evaluated)
-
So maybe we can find out what possession is doing and try to use that, as both plugins are based on :mksession