UI tweaks.

- Hide diagnostics on client exit
- Stop insert on popup focus.
- Hide popup on insertchar (for signature_help)
This commit is contained in:
Ashkan Kiani
2019-11-23 16:14:24 -08:00
parent 42c53d266a
commit d410812311
3 changed files with 20 additions and 5 deletions

View File

@@ -343,9 +343,19 @@ function lsp.start_client(config)
function handlers.on_exit(code, signal)
active_clients[client_id] = nil
uninitialized_clients[client_id] = nil
for _, client_ids in pairs(all_buffer_active_clients) do
local active_buffers = {}
for bufnr, client_ids in pairs(all_buffer_active_clients) do
if client_ids[client_id] then
table.insert(active_buffers, bufnr)
end
client_ids[client_id] = nil
end
-- Buffer level cleanup
vim.schedule(function()
for _, bufnr in ipairs(active_buffers) do
util.buf_clear_diagnostics(bufnr)
end
end)
if config.on_exit then
pcall(config.on_exit, code, signal, client_id)
end