aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-11-14 22:26:22 +0100
committerGitHub <noreply@github.com>2022-11-14 22:26:22 +0100
commit4541c450812bb5252a63307772add143be1ee9c7 (patch)
tree15b8c595ede5b3504948f1eaf3e487a9d050684d /runtime/lua/vim
parentf8c671827710c6e9cca3bfd60c32098b2be8239a (diff)
parente15f61b1bd60f6a198a0d9969cea407784ff71d0 (diff)
downloadrneovim-4541c450812bb5252a63307772add143be1ee9c7.tar.gz
rneovim-4541c450812bb5252a63307772add143be1ee9c7.tar.bz2
rneovim-4541c450812bb5252a63307772add143be1ee9c7.zip
Merge pull request #21054 from max397574/fix/deepcopy_vimNIL
fix(lua): make `vim.deepcopy` work with `vim.NIL`
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/shared.lua3
1 files changed, 3 insertions, 0 deletions
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