-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: disable autostart after :LspStop #2987
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -139,6 +139,9 @@ function configs.__newindex(t, config_name, config_def) | |||||||||||
api.nvim_create_autocmd('BufReadPost', { | ||||||||||||
pattern = fn.fnameescape(root_dir) .. '/*', | ||||||||||||
callback = function(arg) | ||||||||||||
if #M.manager:clients() == 0 then | ||||||||||||
return true | ||||||||||||
end | ||||||||||||
M.manager:try_add_wrapper(arg.buf, root_dir) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the callback check if the client was force stopped? Then it can return
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, with this addressed, other two comments should be also good. Thanks, updated. |
||||||||||||
end, | ||||||||||||
group = lsp_group, | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping there is a way to checking that the clients were force-stopped. Could there be an edge case where the client dies because of an error, which would then (unintentionally) remove this autocmd?
I guess we can try this.
LspStart
will recreate this autocmd again.