ref(highlite): new metatable in use_background_with

We shouldn't alter the contents of `attributes` during the function
call. Instead, we should create a new metatable for the background
color table, and assign it that way.
This commit is contained in:
Iron-E 2020-12-05 17:41:24 -05:00
parent a7a3bc11fe
commit f643c9304d
No known key found for this signature in database
GPG Key ID: 19B71B7B7B021D22
1 changed files with 4 additions and 2 deletions

View File

@ -85,8 +85,10 @@ end
-- Load specific &bg instructions
local function use_background_with(attributes)
attributes.__index = attributes
return setmetatable(attributes[vim.o.background], attributes)
return setmetatable(
attributes[vim.o.background],
{['__index'] = attributes}
)
end
--[[