ldelossa / nvim-ide

A full featured IDE layer for Neovim. Heavily inspired by VSCode.
MIT License
826 stars 27 forks source link

Sort the windows #116

Open rosstang opened 1 year ago

rosstang commented 1 year ago

When there are multiple number of windows (non-components), all other will be closed except the first one. However the windows returned from vim.api.nvim_tabpage_list_wins is not in a meaningful order. So the layout of neovim can be messed up after diff is created.

The fix here is to sort the win list, and it is most likely that the windows with the minimum handle value is the main editor (so the splitting should be done there).

ldelossa commented 12 months ago

Hey @rosstang - sorry took a bit of a hiatus from this project.

If you still want to explore this can you rebase the PR and I'll give it a try?

TBH, I don't suggest using nvim-ide while nvim-dap ui is active, they both are pretty heavy handled about controlling windows. Making them both work nicely may just be one hack after the next, but if this is a simple fix that doesn't break anything else, I'm open to it.