Initial implementation

This commit is contained in:
Iron_E 2020-09-06 14:04:36 -04:00
parent c8ca0582c1
commit 3c0f206029
No known key found for this signature in database
GPG Key ID: B0B37DE7EDC2335F
1 changed files with 9 additions and 0 deletions

View File

@ -72,7 +72,16 @@ end --}}} ‡
-- Generate a `:highlight` command from a group and some attributes. -- Generate a `:highlight` command from a group and some attributes.
local function highlight(highlight_group, attributes) -- {{{ † local function highlight(highlight_group, attributes) -- {{{ †
-- The base highlight command
local highlight_cmd = {'hi! ', highlight_group} local highlight_cmd = {'hi! ', highlight_group}
-- Take care of special instructions for certain background colors.
if attributes[vim.o.background] then
attributes.__index = attributes
attributes = setmetatable(attributes[vim.o.background], attributes)
end
-- Determine if there is a highlight link, and if so, assign it.
local link = (type(attributes) == 'string' and attributes) local link = (type(attributes) == 'string' and attributes)
or attributes.link or attributes.link