lua: metatable for empty dict value

This commit is contained in:
Björn Linse
2019-11-27 20:45:41 +01:00
parent a251b588ac
commit ea4127e9a7
8 changed files with 101 additions and 4 deletions

View File

@@ -244,6 +244,11 @@ function Inspector:putTable(t)
local nonSequentialKeys, nonSequentialKeysLength, sequenceLength = getNonSequentialKeys(t)
local mt = getmetatable(t)
if (vim and sequenceLength == 0 and nonSequentialKeysLength == 0
and mt == vim._empty_dict_mt) then
self:puts(tostring(t))
return
end
self:puts('{')
self:down(function()