diff options
author | Jaehwang Jerry Jung <tomtomjhj@gmail.com> | 2021-06-15 15:07:52 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-14 23:07:52 -0700 |
commit | b8dfa2f112130c1dcb12409f881a3fd83aa5b56d (patch) | |
tree | 7a07c075ae7b8313315cc5c695bda97c2d0f75ce /runtime/lua/vim/lsp/diagnostic.lua | |
parent | 44fad0a7a30a7fb2af1ba912f402fe386f3e1170 (diff) | |
download | rneovim-b8dfa2f112130c1dcb12409f881a3fd83aa5b56d.tar.gz rneovim-b8dfa2f112130c1dcb12409f881a3fd83aa5b56d.tar.bz2 rneovim-b8dfa2f112130c1dcb12409f881a3fd83aa5b56d.zip |
fix(lsp): fix on_detach in lsp.diagnostic
`lsp.diagnostic.get_all()` was returning diagnotics for `:bwipeout`-ed
buffers because the diagnostic cache is not cleared. The first argument
of on_detach callback is the string "detach", not the bufnr.
Diffstat (limited to 'runtime/lua/vim/lsp/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/lsp/diagnostic.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index c6fed54908..d4580885db 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -321,9 +321,9 @@ function M.save(diagnostics, bufnr, client_id) -- Clean up our data when the buffer unloads. api.nvim_buf_attach(bufnr, false, { - on_detach = function(b) + on_detach = function(_, b) clear_diagnostic_cache(b, client_id) - _diagnostic_cleanup[bufnr][client_id] = nil + _diagnostic_cleanup[b][client_id] = nil end }) end |