From 3c0f206029de95c461e81d9dd54851977a0f897a Mon Sep 17 00:00:00 2001 From: Iron_E Date: Sun, 6 Sep 2020 14:04:36 -0400 Subject: [PATCH] Initial implementation --- lua/highlite.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/highlite.lua b/lua/highlite.lua index 3d26898..975a50f 100644 --- a/lua/highlite.lua +++ b/lua/highlite.lua @@ -72,7 +72,16 @@ end --}}} ‡ -- Generate a `:highlight` command from a group and some attributes. local function highlight(highlight_group, attributes) -- {{{ † + -- The base highlight command 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) or attributes.link