simrat39 / symbols-outline.nvim

A tree like view for symbols in Neovim using the Language Server Protocol. Supports all your favourite languages.
MIT License
1.85k stars 97 forks source link

Open handler checks if view is not already open #235

Open eyalz800 opened 10 months ago

eyalz800 commented 10 months ago

I sometimes get a weird error that says "failed to rename buffer" and then symbols-outline opens multiple windows and runs into a bad state. I reproduced it a few times when I pressed the keybinding to open before the LSP is ready and then the handler gets called multiple times. After this change and spamming the keybinding I can no longer reproduce this issue symbols-outline.

I don't know if that's sufficient detail to accept this change and whether you will be able to reproduce this edge case but according to the handler implementation it seems like it's always a bad idea to call it when the outline is already open and even without reproduction it makes sense to check it rather than get into this bad state.

hedyhli commented 8 months ago

I can reproduce this and verified the messy state is no longer the case after the fix.