2023-12-06 16:44:46 +08:00
|
|
|
local highlights = require('flexoki.highlights')
|
2023-11-01 01:09:02 +08:00
|
|
|
|
|
|
|
local hl = vim.api.nvim_set_hl
|
|
|
|
|
2023-11-01 03:15:26 +08:00
|
|
|
local M = {}
|
|
|
|
|
2023-12-06 16:44:46 +08:00
|
|
|
---@param opts FlexokiOptions
|
|
|
|
M.set_highlights = function(opts)
|
2023-11-01 03:15:26 +08:00
|
|
|
|
2023-12-06 16:44:46 +08:00
|
|
|
local highlight_groups = highlights.groups()
|
2023-11-01 01:09:02 +08:00
|
|
|
|
2023-12-06 16:44:46 +08:00
|
|
|
-- Set users highlight_group customisations.
|
|
|
|
if not opts.highlight_groups == nil then
|
|
|
|
for group, highlight in pairs(opts.highlight_groups) do
|
|
|
|
highlight_groups[group] = highlight
|
|
|
|
end
|
|
|
|
end
|
2023-11-01 01:09:02 +08:00
|
|
|
|
2023-12-06 16:44:46 +08:00
|
|
|
for group, highlight in pairs(highlight_groups) do
|
|
|
|
hl(0, group, highlight)
|
|
|
|
end
|
2023-11-01 01:09:02 +08:00
|
|
|
end
|
|
|
|
|
2023-11-01 03:15:26 +08:00
|
|
|
return M
|