improv: highlight link immediately
authorTran Duc Binh <binhtran432k@gmail.com>
Tue, 23 Aug 2022 01:36:32 +0000 (08:36 +0700)
committerTran Duc Binh <binhtran432k@gmail.com>
Tue, 23 Aug 2022 01:36:32 +0000 (08:36 +0700)
lua/dracula/init.lua

index 36d5e85d70e9584b10154bb3d2b4fef4e42c4ffc..03a0891b58f685472d6d917c58bc02aa2d1b0251 100644 (file)
@@ -66,22 +66,15 @@ local function apply(configs)
       groups[group] = setting
    end
 
-   local links = {} ---@type table<string, Highlight>
    -- run defined highlights
    for group, value in pairs(groups) do
       if type(value) == "table" then
          ---@cast value Highlight
          nvim_set_hl(0, group, value)
       elseif type(value) == "string" then
-         -- make sure links will run later
-         links[group] = { link = value }
+         nvim_set_hl(0, group, { link = value })
       end
    end
-
-   -- run highlights link commands
-   for group, setting in pairs(links) do
-      nvim_set_hl(0, group, setting)
-   end
 end
 
 local local_configs = DEFAULT_CONFIG