diff options
author | Tim Keller <tjkeller.xyz> | 2024-11-27 20:05:51 -0600 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2024-11-27 20:05:51 -0600 |
commit | 35e36ce317d8ac8fa579118f5a16ca35bd47e353 (patch) | |
tree | 79b13adb813ea0ce539151c359a73f18105244e9 /lua/luatab/highlight.lua | |
parent | 1b488d80772e59c6fde2453929d4060118c39983 (diff) | |
download | minitab.nvim-35e36ce317d8ac8fa579118f5a16ca35bd47e353.tar.xz minitab.nvim-35e36ce317d8ac8fa579118f5a16ca35bd47e353.zip |
change to cleantab
Diffstat (limited to 'lua/luatab/highlight.lua')
-rw-r--r-- | lua/luatab/highlight.lua | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lua/luatab/highlight.lua b/lua/luatab/highlight.lua deleted file mode 100644 index c696135..0000000 --- a/lua/luatab/highlight.lua +++ /dev/null @@ -1,40 +0,0 @@ --- Shamelessly stolen from --- https://github.com/hoob3rt/lualine.nvim/blob/master/lua/lualine/utils/utils.lua - -local M = {} - -M.highlight = function(name, foreground, background) - local command = {'highlight', name} - if foreground and foreground ~= 'none' then - table.insert(command, 'guifg=' .. foreground) - end - if background and background ~= 'none' then - table.insert(command, 'guibg=' .. background) - end - vim.cmd(table.concat(command, ' ')) -end - -M.create_component_highlight_group = function(color, highlight_tag) - if color.bg and color.fg then - local highlight_group_name = table.concat({'luatab', highlight_tag}, '_') - M.highlight(highlight_group_name, color.fg, color.bg) - return highlight_group_name - end -end - -M.extract_highlight_colors = function(color_group, scope) - if vim.fn.hlexists(color_group) == 0 then return nil end - local color = vim.api.nvim_get_hl_by_name(color_group, true) - if color.background ~= nil then - color.bg = string.format('#%06x', color.background) - color.background = nil - end - if color.foreground ~= nil then - color.fg = string.format('#%06x', color.foreground) - color.foreground = nil - end - if scope then return color[scope] end - return color -end - -return M |