Skip to content

Commit 5ca4040

Browse files
committed
add highlight method
1 parent 2b65ba4 commit 5ca4040

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lua/cosmic-ui/init.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,14 @@ M.rename = function(popup_opts, opts)
44
return require('cosmic-ui.rename')(popup_opts, opts)
55
end
66

7+
M.highlight = function(group, bg, fg, gui)
8+
if gui ~= nil and gui ~= '' then
9+
vim.api.nvim_command(('hi %s guibg=%s guifg=%s gui=%s'):format(group, bg, fg, gui))
10+
elseif bg == nil then
11+
vim.api.nvim_command(('hi %s guifg=%s'):format(group, fg))
12+
else
13+
vim.api.nvim_command(('hi %s guibg=%s guifg=%s'):format(group, bg, fg))
14+
end
15+
end
16+
717
return M

0 commit comments

Comments
 (0)