From 444f175335f0fbe338931f977880e959afbb49b7 Mon Sep 17 00:00:00 2001 From: Akin Sowemimo Date: Tue, 18 May 2021 23:28:09 +0100 Subject: fix(lsp): do not convert vim.NIL to nil in lists --- runtime/lua/vim/lsp/rpc.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime/lua') diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua index 98835d6708..ea12c97d40 100644 --- a/runtime/lua/vim/lsp/rpc.lua +++ b/runtime/lua/vim/lsp/rpc.lua @@ -50,8 +50,13 @@ recursive_convert_NIL = function(v, tbl_processed) return nil elseif not tbl_processed[v] and type(v) == 'table' then tbl_processed[v] = true + local inside_list = vim.tbl_islist(v) return vim.tbl_map(function(x) - return recursive_convert_NIL(x, tbl_processed) + if not inside_list or (inside_list and type(x) == "table") then + return recursive_convert_NIL(x, tbl_processed) + else + return x + end end, v) end -- cgit