From 8725c63941b04c91289a3502acba87c42ac2f082 Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Mon, 22 Nov 2021 10:12:19 +0600 Subject: [PATCH] enhance: add more fallback colors for diff component --- lua/lualine/components/diff/init.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lua/lualine/components/diff/init.lua b/lua/lualine/components/diff/init.lua index 917549c..6ec33e5 100644 --- a/lua/lualine/components/diff/init.lua +++ b/lua/lualine/components/diff/init.lua @@ -14,13 +14,25 @@ local default_options = { symbols = { added = '+', modified = '~', removed = '-' }, diff_color = { added = { - fg = modules.utils.extract_highlight_colors('DiffAdd', 'fg') or '#90ee90', + fg = modules.utils.extract_color_from_hllist( + 'fg', + { 'GitSignsAdd', 'GitGutterAdd', 'DiffAdded', 'DiffAdd' }, + '#90ee90' + ), }, modified = { - fg = modules.utils.extract_highlight_colors('DiffChange', 'fg') or '#f0e130', + fg = modules.utils.extract_color_from_hllist( + 'fg', + { 'GitSignsChange', 'GitGutterChange', 'DiffChanged', 'DiffChange' }, + '#f0e130' + ), }, removed = { - fg = modules.utils.extract_highlight_colors('DiffDelete', 'fg') or '#ff0038', + fg = modules.utils.extract_color_from_hllist( + 'fg', + { 'GitSignsDelete', 'GitGutterDelete', 'DiffRemoved', 'DiffDelete' }, + '#ff0038' + ), }, }, }