fix(lsp): resolve nil bufnr (#16902)

Related: #16889, #16745
This commit is contained in:
Gregory Anders 2022-01-03 12:40:09 -07:00 committed by GitHub
parent 6aeaff1220
commit e6c1545b19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1505,7 +1505,7 @@ do --[[ References ]]
---@param bufnr number Buffer id
function M.buf_clear_references(bufnr)
validate { bufnr = {bufnr, 'n', true} }
api.nvim_buf_clear_namespace(bufnr, reference_ns, 0, -1)
api.nvim_buf_clear_namespace(bufnr or 0, reference_ns, 0, -1)
end
--- Shows a list of document highlights for a certain buffer.