From 292ffbb2eabc1b7e10725b79a141fcfb6cdeefd7 Mon Sep 17 00:00:00 2001 From: Matt Leong Date: Fri, 12 Nov 2021 13:07:04 -0800 Subject: [PATCH] fix(highlights): remove highlight link --- lua/cosmic/core/statusline/init.lua | 50 +++++++++---------- lua/cosmic/core/theme/highlights.lua | 8 +-- .../core/theme/integrated/catppuccin.lua | 2 +- lua/cosmic/core/theme/integrated/gruvbox.lua | 2 +- lua/cosmic/core/theme/integrated/nord.lua | 2 +- lua/cosmic/core/theme/integrated/rosepine.lua | 2 +- .../core/theme/integrated/tokyonight.lua | 2 +- 7 files changed, 32 insertions(+), 36 deletions(-) diff --git a/lua/cosmic/core/statusline/init.lua b/lua/cosmic/core/statusline/init.lua index e18f4bc..10d3621 100644 --- a/lua/cosmic/core/statusline/init.lua +++ b/lua/cosmic/core/statusline/init.lua @@ -161,10 +161,10 @@ gls.left = { local label, mode_color, mode_nested = unpack(m) highlight('GalaxyViMode', mode_color, mode_nested) highlight('GalaxyViModeInv', mode_nested, mode_color) - highlight('GalaxyViModeNested', mode_nested, colors.bg_dark) - highlight('GalaxyViModeNestedInv', colors.bg_dark, mode_nested) - highlight('GalaxyPercentBracket', colors.bg_dark, mode_color) - highlight('GalaxyText', colors.bg_dark, mode_color) + highlight('GalaxyViModeNested', mode_nested, colors.statusline_bg) + highlight('GalaxyViModeNestedInv', colors.statusline_bg, mode_nested) + highlight('GalaxyPercentBracket', colors.statusline_bg, mode_color) + highlight('GalaxyText', colors.statusline_bg, mode_color) highlight('GalaxyGitLCBracket', mode_nested, mode_color) @@ -172,9 +172,9 @@ gls.left = { highlight('GalaxyViModeBracket', mode_nested, mode_color) else if condition.check_git_workspace() then - highlight('GalaxyGitLCBracket', colors.bg_dark, mode_color) + highlight('GalaxyGitLCBracket', colors.statusline_bg, mode_color) end - highlight('GalaxyViModeBracket', colors.bg_dark, mode_color) + highlight('GalaxyViModeBracket', colors.statusline_bg, mode_color) end return ' ' .. label .. ' ' end, @@ -247,7 +247,7 @@ gls.left = { provider = 'DiffAdd', icon = '  ', condition = check_width_and_git_and_buffer, - highlight = { colors.diffAdd, colors.bg_dark }, + highlight = { colors.diffAdd, colors.statusline_bg }, }, }, { @@ -255,7 +255,7 @@ gls.left = { provider = 'DiffModified', condition = check_width_and_git_and_buffer, icon = '  ', - highlight = { colors.diffModified, colors.bg_dark }, + highlight = { colors.diffModified, colors.statusline_bg }, }, }, { @@ -263,13 +263,13 @@ gls.left = { provider = 'DiffRemove', condition = check_width_and_git_and_buffer, icon = '  ', - highlight = { colors.diffDeleted, colors.bg_dark }, + highlight = { colors.diffDeleted, colors.statusline_bg }, }, }, { WSpace = { provider = 'WhiteSpace', - highlight = { colors.bg_dark, colors.bg_dark }, + highlight = { colors.statusline_bg, colors.statusline_bg }, }, }, } @@ -286,8 +286,8 @@ gls.right = { DiagnosticError = { provider = function() local error_result = diag.get_diagnostic_error() - highlight('GalaxyDiagnosticError', colors.error, colors.bg_dark) - highlight('GalaxyDiagnosticErrorInv', colors.bg_dark, colors.error) + highlight('GalaxyDiagnosticError', colors.error, colors.statusline_bg) + highlight('GalaxyDiagnosticErrorInv', colors.statusline_bg, colors.error) if error_result ~= '' and error_result ~= nil then return error_result @@ -319,8 +319,8 @@ gls.right = { DiagnosticWarn = { provider = function() local warn_result = diag.get_diagnostic_warn() - highlight('GalaxyDiagnosticWarn', colors.warn, colors.bg_dark) - highlight('GalaxyDiagnosticWarnInv', colors.bg_dark, colors.warn) + highlight('GalaxyDiagnosticWarn', colors.warn, colors.statusline_bg) + highlight('GalaxyDiagnosticWarnInv', colors.statusline_bg, colors.warn) if warn_result ~= '' and warn_result ~= nil then return warn_result @@ -351,8 +351,8 @@ gls.right = { DiagnosticInfo = { provider = function() local info_result = diag.get_diagnostic_info() - highlight('GalaxyDiagnosticInfo', colors.info, colors.bg_dark) - highlight('GalaxyDiagnosticInfoInv', colors.bg_dark, colors.info) + highlight('GalaxyDiagnosticInfo', colors.info, colors.statusline_bg) + highlight('GalaxyDiagnosticInfoInv', colors.statusline_bg, colors.info) if info_result ~= '' and info_result ~= nil then return info_result @@ -423,19 +423,19 @@ gls.short_line_left = { { GhostLeftBracketShort = { provider = BracketProvider(icons.rounded_left_filled, true), - highlight = { colors.white, colors.bg_dark }, + highlight = { colors.white, colors.statusline_bg }, }, }, { GhostShort = { provider = BracketProvider(main_icon, true), - highlight = { colors.bg_dark, colors.white }, + highlight = { colors.statusline_bg, colors.white }, }, }, { GhostRightBracketShort = { provider = BracketProvider(icons.rounded_right_filled, true), - highlight = { colors.white, colors.bg_dark }, + highlight = { colors.white, colors.statusline_bg }, }, }, { @@ -451,7 +451,7 @@ gls.short_line_left = { end, highlight = { require('galaxyline.providers.fileinfo').get_file_icon, - colors.bg_dark, + colors.statusline_bg, }, }, }, @@ -461,7 +461,7 @@ gls.short_line_left = { condition = function() return condition.buffer_not_empty() and vim.bo.filetype ~= 'NvimTree' end, - highlight = { colors.white, colors.bg_dark }, + highlight = { colors.white, colors.statusline_bg }, }, }, { @@ -470,7 +470,7 @@ gls.short_line_left = { condition = function() return condition.buffer_not_empty() and vim.bo.filetype ~= 'NvimTree' end, - highlight = { colors.white, colors.bg_dark }, + highlight = { colors.white, colors.statusline_bg }, }, }, } @@ -480,7 +480,7 @@ gls.short_line_right = { GitRootShortLeftBracket = { provider = BracketProvider(icons.arrow_left_filled, true), condition = condition.buffer_not_empty, - highlight = { colors.white, colors.bg_dark }, + highlight = { colors.white, colors.statusline_bg }, }, }, { @@ -488,14 +488,14 @@ gls.short_line_right = { provider = get_git_root, condition = condition.buffer_not_empty, icon = ' ' .. icons.file .. ' ', - highlight = { colors.bg_dark, colors.white }, + highlight = { colors.statusline_bg, colors.white }, }, }, { GitRootShortRightBracket = { provider = BracketProvider(icons.rounded_right_filled, true), condition = condition.buffer_not_empty, - highlight = { colors.white, colors.bg_dark }, + highlight = { colors.white, colors.statusline_bg }, }, }, } diff --git a/lua/cosmic/core/theme/highlights.lua b/lua/cosmic/core/theme/highlights.lua index 39cfb12..f2496d9 100644 --- a/lua/cosmic/core/theme/highlights.lua +++ b/lua/cosmic/core/theme/highlights.lua @@ -56,13 +56,9 @@ highlight('NotifyTRACEIcon', nil, colors.trace) highlight('TelescopeBorder', 'None', colors.floatBorder) highlight('FloatermBorder', 'None', colors.floatBorder) +highlight('StatusLine', colors.statusline_bg, 'StatusLine') highlight('FloatBorder', 'None', colors.floatBorder) -highlight('StatusLine', colors.bg_dark, 'StatusLine') - -vim.cmd([[ -highlight clear NormalFloat -highlight link NormalFloat Normal -]]) +highlight('NormalFloat', 'Normal', 'Normal') local config = require('cosmic.config') if config.theme == 'gruvbox.nvim' then diff --git a/lua/cosmic/core/theme/integrated/catppuccin.lua b/lua/cosmic/core/theme/integrated/catppuccin.lua index c6a595d..cadafcb 100644 --- a/lua/cosmic/core/theme/integrated/catppuccin.lua +++ b/lua/cosmic/core/theme/integrated/catppuccin.lua @@ -4,7 +4,7 @@ local colors = { white = theme.catppuccin0, bg = theme.catppuccin12, bg_highlight = theme.catppuccin15, - bg_dark = theme.catppuccin14, + statusline_bg = theme.catppuccin14, normal = theme.catppuccin3, insert = theme.catppuccin4, command = theme.catppuccin5, diff --git a/lua/cosmic/core/theme/integrated/gruvbox.lua b/lua/cosmic/core/theme/integrated/gruvbox.lua index 5fe2555..cb6c7a5 100644 --- a/lua/cosmic/core/theme/integrated/gruvbox.lua +++ b/lua/cosmic/core/theme/integrated/gruvbox.lua @@ -5,7 +5,7 @@ local colors = { white = convert.hsl_to_hex(theme.light0_hard), bg = convert.hsl_to_hex(theme.dark0), bg_highlight = convert.hsl_to_hex(theme.dark1), - bg_dark = convert.hsl_to_hex(theme.dark2), + statusline_bg = convert.hsl_to_hex(theme.dark2), normal = convert.hsl_to_hex(theme.neutral_yellow), insert = convert.hsl_to_hex(theme.neutral_green), command = convert.hsl_to_hex(theme.neutral_orange), diff --git a/lua/cosmic/core/theme/integrated/nord.lua b/lua/cosmic/core/theme/integrated/nord.lua index 7e2df0e..08bd101 100644 --- a/lua/cosmic/core/theme/integrated/nord.lua +++ b/lua/cosmic/core/theme/integrated/nord.lua @@ -3,7 +3,7 @@ local colors = { white = theme.nord4_gui, bg = theme.nord2_gui, bg_highlight = theme.nord2_gui, - bg_dark = theme.nord0_gui, + statusline_bg = theme.nord0_gui, normal = theme.nord9_gui, insert = theme.nord14_gui, command = theme.nord13_gui, diff --git a/lua/cosmic/core/theme/integrated/rosepine.lua b/lua/cosmic/core/theme/integrated/rosepine.lua index 96c2b54..33f19ba 100644 --- a/lua/cosmic/core/theme/integrated/rosepine.lua +++ b/lua/cosmic/core/theme/integrated/rosepine.lua @@ -3,7 +3,7 @@ local colors = { white = theme.text, bg = theme.surface, bg_highlight = theme.surface, - bg_dark = theme.base, + statusline_bg = theme.base, normal = theme.pine, insert = theme.foam, command = theme.gold, diff --git a/lua/cosmic/core/theme/integrated/tokyonight.lua b/lua/cosmic/core/theme/integrated/tokyonight.lua index 8da9efb..08f87ad 100644 --- a/lua/cosmic/core/theme/integrated/tokyonight.lua +++ b/lua/cosmic/core/theme/integrated/tokyonight.lua @@ -5,7 +5,7 @@ local colors = { white = themeColors.fg_dark, bg = themeColors.bg, bg_highlight = themeColors.bg_highlight, - bg_dark = themeColors.bg_dark, + statusline_bg = themeColors.bg_dark, normal = themeColors.blue, insert = themeColors.teal, command = themeColors.orange,