From 921f85c99ad98f0b156e6ddbbc5ac9318850071d Mon Sep 17 00:00:00 2001 From: Webhooked Date: Wed, 7 May 2025 11:34:40 +0200 Subject: [PATCH] Add support for untracked files in Git signs --- lua/kanso/colors.lua | 16 +++++++++------- lua/kanso/highlights/plugins.lua | 4 ++++ lua/kanso/themes.lua | 22 +++++++++++++--------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/lua/kanso/colors.lua b/lua/kanso/colors.lua index 3fd15b4..9b1d747 100644 --- a/lua/kanso/colors.lua +++ b/lua/kanso/colors.lua @@ -67,12 +67,12 @@ local palette = { inkGray2 = "#75797f", inkGray3 = "#5C6066", inkBlue2 = "#8ba4b0", - inkViolet= "#8992a7", + inkViolet = "#8992a7", inkRed = "#c4746e", inkAqua = "#8ea4a2", - inkAsh = "#5C6068", - inkTeal = "#949fb5", - inkYellow = "#c4b28a",--"#a99c8b", + inkAsh = "#5C6066", + inkTeal = "#949fb5", + inkYellow = "#c4b28a", --"#a99c8b", -- "#8a9aa3", pearlInk0 = "#24262D", @@ -101,7 +101,7 @@ local palette = { pearlPink = "#b35b79", pearlOrange = "#cc6d00", pearlOrange2 = "#e98a00", - pearlYellow ="#77713f", + pearlYellow = "#77713f", pearlYellow2 = "#836f4a", pearlYellow3 = "#de9800", pearlYellow4 = "#f9d791", @@ -132,7 +132,8 @@ function M.setup(opts) local theme = opts.theme or require("kanso")._CURRENT_THEME -- WARN: this fails if called before kanso.load() if not theme then - error("kanso.colors.setup(): Unable to infer `theme`. Either specify a theme or call this function after ':colorscheme kanso'") + error( + "kanso.colors.setup(): Unable to infer `theme`. Either specify a theme or call this function after ':colorscheme kanso'") end -- Add to and/or override palette_colors @@ -142,7 +143,8 @@ function M.setup(opts) local theme_colors = require("kanso.themes")[theme](updated_palette_colors) -- Add to and/or override theme_colors - local theme_overrides = vim.tbl_deep_extend("force", override_colors.theme["all"] or {}, override_colors.theme[theme] or {} ) + local theme_overrides = vim.tbl_deep_extend("force", override_colors.theme["all"] or {}, + override_colors.theme[theme] or {}) local updated_theme_colors = vim.tbl_deep_extend("force", theme_colors, theme_overrides) -- return palette_colors AND theme_colors diff --git a/lua/kanso/highlights/plugins.lua b/lua/kanso/highlights/plugins.lua index c6e6ad0..845a234 100644 --- a/lua/kanso/highlights/plugins.lua +++ b/lua/kanso/highlights/plugins.lua @@ -25,6 +25,10 @@ function M.setup(colors, config) GitSignsAdd = { fg = theme.vcs.added, bg = theme.ui.none }, GitSignsChange = { fg = theme.vcs.changed, bg = theme.ui.none }, GitSignsDelete = { fg = theme.vcs.removed, bg = theme.ui.none }, + GitSignsChangedelete = { fg = theme.vcs.removed, bg = theme.ui.none }, + GitSignsTopdelete = { fg = theme.vcs.removed, bg = theme.ui.none }, + GitSignsUntracked = { fg = theme.vcs.untracked, bg = theme.ui.none }, + -- Neogit NeogitDiffContextHighlight = { bg = theme.diff.change }, --[[ guibg=#333333 guifg=#b2b2b2 ]] NeogitHunkHeader = { fg = theme.syn.fun }, --[[ guifg=#cccccc guibg=#404040 ]] diff --git a/lua/kanso/themes.lua b/lua/kanso/themes.lua index 53b87dc..44365b6 100644 --- a/lua/kanso/themes.lua +++ b/lua/kanso/themes.lua @@ -41,6 +41,7 @@ local c = require("kanso.lib.color") ---@field added ColorSpec ---@field removed ColorSpec ---@field changed ColorSpec +---@field untracked ColorSpec ---@class UiElements ---@field none ColorSpec @@ -175,9 +176,10 @@ return { text = palette.winterYellow, }, vcs = { - added = palette.autumnGreen, - removed = palette.autumnRed, - changed = palette.autumnYellow, + added = palette.autumnGreen, + removed = palette.autumnRed, + changed = palette.autumnYellow, + untracked = palette.inkGray2 }, term = { palette.zen0, -- black @@ -284,9 +286,10 @@ return { text = palette.winterYellow, }, vcs = { - added = palette.autumnGreen, - removed = palette.autumnRed, - changed = palette.autumnYellow, + added = palette.autumnGreen, + removed = palette.autumnRed, + changed = palette.autumnYellow, + untracked = palette.inkGray2 }, term = { palette.inkBlack0, -- black @@ -379,9 +382,10 @@ return { special3 = palette.pearlViolet4, }, vcs = { - added = palette.pearlGreen2, - removed = palette.pearlRed2, - changed = palette.pearlYellow3, + added = palette.pearlGreen2, + removed = palette.pearlRed2, + changed = palette.pearlYellow3, + untracked = palette.pearlGray4 }, diff = { add = palette.pearlGreen3,