From 7ac283f05074485c08aefe578a139e34d508edb9 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Mon, 24 Jun 2024 13:28:34 +0100 Subject: [PATCH] plugins/gitsigns: remove deprecated options --- plugins/git/gitsigns/default.nix | 121 +++++++++++-------------------- plugins/git/gitsigns/options.nix | 26 ------- 2 files changed, 41 insertions(+), 106 deletions(-) diff --git a/plugins/git/gitsigns/default.nix b/plugins/git/gitsigns/default.nix index 31cb5f9f0f..b77762bd5a 100644 --- a/plugins/git/gitsigns/default.nix +++ b/plugins/git/gitsigns/default.nix @@ -16,126 +16,51 @@ helpers.neovim-plugin.mkNeovimPlugin config { # TODO: introduced 2024-03-12, remove on 2024-05-12 deprecateExtraOptions = true; optionsRenamedToSettings = [ - [ - "signs" - "add" - "hl" - ] [ "signs" "add" "text" ] - [ - "signs" - "add" - "numhl" - ] - [ - "signs" - "add" - "linehl" - ] [ "signs" "add" "showCount" ] - [ - "signs" - "change" - "hl" - ] [ "signs" "change" "text" ] - [ - "signs" - "change" - "numhl" - ] - [ - "signs" - "change" - "linehl" - ] [ "signs" "change" "showCount" ] - [ - "signs" - "topdelete" - "hl" - ] [ "signs" "topdelete" "text" ] - [ - "signs" - "topdelete" - "numhl" - ] - [ - "signs" - "topdelete" - "linehl" - ] [ "signs" "topdelete" "showCount" ] - [ - "signs" - "changedelete" - "hl" - ] [ "signs" "changedelete" "text" ] - [ - "signs" - "changedelete" - "numhl" - ] - [ - "signs" - "changedelete" - "linehl" - ] [ "signs" "changedelete" "showCount" ] - [ - "signs" - "untracked" - "hl" - ] [ "signs" "untracked" "text" ] - [ - "signs" - "untracked" - "numhl" - ] - [ - "signs" - "untracked" - "linehl" - ] [ "signs" "untracked" @@ -195,10 +120,6 @@ helpers.neovim-plugin.mkNeovimPlugin config { "virtTextPriority" ] "trouble" - [ - "yadm" - "enable" - ] "wordDiff" "debugMode" ]; @@ -209,8 +130,41 @@ helpers.neovim-plugin.mkNeovimPlugin config { "gitsigns" ]; settingsPath = basePluginPaths ++ [ "settings" ]; + + highlights = { + add = "Add"; + change = "Change"; + delete = "Delete"; + topdelete = "Topdelete"; + changedelete = "Changedelete"; + untracked = "Untracked"; + }; + + subHighlights = { + hl = ""; + linehl = "Ln"; + numhl = "Nr"; + }; + + highlightRemovals = flatten ( + mapAttrsToList ( + opt: hlg: + mapAttrsToList (subOpt: subHlg: { + optionPath = settingsPath ++ [ + "signs" + opt + subOpt + ]; + hlg = "GitSigns${hlg}${subHlg}"; + }) subHighlights + ) highlights + ); in - [ + (map ( + { optionPath, hlg }: + helpers.mkDeprecatedSubOptionModule optionPath "Please define the `${hlg}` highlight group instead." + ) highlightRemovals) + ++ [ (mkRenamedOptionModule ( basePluginPaths ++ [ @@ -278,6 +232,13 @@ helpers.neovim-plugin.mkNeovimPlugin config { "nonCommitted" ] ) (settingsPath ++ [ "current_line_blame_formatter_nc" ])) + (helpers.mkDeprecatedSubOptionModule ( + settingsPath + ++ [ + "yadm" + "enable" + ] + ) "yadm support was removed upstream.") ]; extraOptions = { diff --git a/plugins/git/gitsigns/options.nix b/plugins/git/gitsigns/options.nix index e1c9911e53..178105314d 100644 --- a/plugins/git/gitsigns/options.nix +++ b/plugins/git/gitsigns/options.nix @@ -3,28 +3,11 @@ with lib; { signs = let - # TODO (2024-06-24): find a way to properly remove the `hl`, `numhl` and `linehl` options - # https://github.com/lewis6991/gitsigns.nvim/issues/453#issuecomment-2178736570 signOptions = defaults: { - hl = helpers.defaultNullOpts.mkStr defaults.hl '' - **DEPRECATED** - Specifies the highlight group to use for the sign. - ''; - text = helpers.defaultNullOpts.mkStr defaults.text '' Specifies the character to use for the sign. ''; - numhl = helpers.defaultNullOpts.mkStr defaults.numhl '' - **DEPRECATED** - Specifies the highlight group to use for the number column. - ''; - - linehl = helpers.defaultNullOpts.mkStr defaults.linehl '' - **DEPRECATED** - Specifies the highlight group to use for the line. - ''; - show_count = helpers.defaultNullOpts.mkBool false '' Showing count of hunk, e.g. number of deleted lines. ''; @@ -422,15 +405,6 @@ with lib; Default: `pcall(require, 'trouble')` ''; - yadm = { - # TODO (2024-06-24): find a way to properly remove this option - # https://github.com/lewis6991/gitsigns.nvim/issues/453#issuecomment-2178743878 - enable = helpers.defaultNullOpts.mkBool false '' - **DEPRECATED** - Enable YADM support. - ''; - }; - word_diff = helpers.defaultNullOpts.mkBool false '' Highlight intra-line word differences in the buffer. Requires `config.diff_opts.internal = true`.