From e15f61b1bd60f6a198a0d9969cea407784ff71d0 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 14 Nov 2022 20:26:27 +0100 Subject: fix(lua): make `vim.deepcopy` work with `vim.NIL` style: changed double quotes to single quotes feat: add tests fix tests --- runtime/lua/vim/shared.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/lua/vim/shared.lua') diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua index f980547ae4..f4a57c13c8 100644 --- a/runtime/lua/vim/shared.lua +++ b/runtime/lua/vim/shared.lua @@ -49,6 +49,9 @@ vim.deepcopy = (function() if f then return f(orig, cache or {}) else + if type(orig) == 'userdata' and orig == vim.NIL then + return vim.NIL + end error('Cannot deepcopy object of type ' .. type(orig)) end end -- cgit