Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add config option to set gui style for sign #244

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lua/todo-comments/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ local defaults = {
gui_style = {
fg = "NONE", -- The gui style to use for the fg highlight group.
bg = "BOLD", -- The gui style to use for the bg highlight group.
sign = "NONE", -- The gui style to use for the sign highlight group.
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- highlighting of the line containing the todo comment
Expand Down Expand Up @@ -153,6 +154,7 @@ function M.colors()
fg_light = fg_light or "#ffffff"
local fg_gui = M.options.gui_style.fg
local bg_gui = M.options.gui_style.bg
local sign_gui = M.options.gui_style.sign

local sign_hl = Util.get_hl("SignColumn")
local sign_bg = (sign_hl and sign_hl.background) and sign_hl.background or "NONE"
Expand Down Expand Up @@ -186,7 +188,7 @@ function M.colors()

vim.cmd("hi def TodoBg" .. kw .. " guibg=" .. hex .. " guifg=" .. fg .. " gui=" .. bg_gui)
vim.cmd("hi def TodoFg" .. kw .. " guibg=NONE guifg=" .. hex .. " gui=" .. fg_gui)
vim.cmd("hi def TodoSign" .. kw .. " guibg=" .. sign_bg .. " guifg=" .. hex .. " gui=NONE")
vim.cmd("hi def TodoSign" .. kw .. " guibg=" .. sign_bg .. " guifg=" .. hex .. " gui=" .. sign_gui )
end
end

Expand Down