autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 273 forks source link

Do not call LanguageClient#handleBufWritePost on :wq #1128

Closed martskins closed 3 years ago

martskins commented 3 years ago

This PR fixes an issue with us calling LanguageClient#handleBufWritePost on :wq, causing the client to log an error to the console after leaving vim due to it not being able to complete that call.

Fixes #1127

iddinev commented 3 years ago

Just did it a quick test on my machine - issue is no longer observed.

martskins commented 3 years ago

Just found an issue with this. If you use :q to quit a window (not vim) then it will set the quitting flag. The proper event should be VimLeavePre but that doesn't seem to solve the issue for some reason. Looking into v:exiting as well.

Will push a new commit in a while.

martskins commented 3 years ago

I think it should be definitely fixed now. v:exiting is a neovim only feature, but I haven't been able to reproduce this on vim8, I suppose the send on a closed channel reacts differently there.