Skip to content

Commit

Permalink
plugins/gitsigns: remove deprecated options
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Jun 25, 2024
1 parent 54d1188 commit 7ac283f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 106 deletions.
121 changes: 41 additions & 80 deletions plugins/git/gitsigns/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -195,10 +120,6 @@ helpers.neovim-plugin.mkNeovimPlugin config {
"virtTextPriority"
]
"trouble"
[
"yadm"
"enable"
]
"wordDiff"
"debugMode"
];
Expand All @@ -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
++ [
Expand Down Expand Up @@ -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 = {
Expand Down
26 changes: 0 additions & 26 deletions plugins/git/gitsigns/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
'';
Expand Down Expand Up @@ -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`.
Expand Down

0 comments on commit 7ac283f

Please sign in to comment.