feat: add overrides
authorTran Duc Binh <binhtran432k@gmail.com>
Mon, 22 Aug 2022 09:34:41 +0000 (16:34 +0700)
committerTran Duc Binh <binhtran432k@gmail.com>
Mon, 22 Aug 2022 09:43:07 +0000 (16:43 +0700)
lua/dracula/init.lua

index 11a384ae5636574c3055afcb7dd18f419ef9b4fc..36d5e85d70e9584b10154bb3d2b4fef4e42c4ffc 100644 (file)
@@ -10,12 +10,14 @@ local tbl_deep_extend = vim.tbl_deep_extend
 ---@field show_end_of_buffer boolean
 ---@field lualine_bg_color string?
 ---@field colors Palette
+---@field overrides table<string, Highlight|string>
 local DEFAULT_CONFIG = {
    italic_comment = false,
    transparent_bg = false,
    show_end_of_buffer = false,
    lualine_bg_color = nil,
    colors = require("dracula.palette"),
+   overrides = {},
 }
 
 local TRANSPARENTS = {
@@ -60,6 +62,10 @@ local function apply(configs)
       end
    end
 
+   for group, setting in pairs(configs.overrides) do
+      groups[group] = setting
+   end
+
    local links = {} ---@type table<string, Highlight>
    -- run defined highlights
    for group, value in pairs(groups) do