plugins/gitsigns: remove deprecated options

This commit is contained in:
Matt Sturgeon 2024-06-24 13:28:34 +01:00
parent 54d118869b
commit 7ac283f050
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 41 additions and 106 deletions

View file

@ -16,126 +16,51 @@ helpers.neovim-plugin.mkNeovimPlugin config {
# TODO: introduced 2024-03-12, remove on 2024-05-12 # TODO: introduced 2024-03-12, remove on 2024-05-12
deprecateExtraOptions = true; deprecateExtraOptions = true;
optionsRenamedToSettings = [ optionsRenamedToSettings = [
[
"signs"
"add"
"hl"
]
[ [
"signs" "signs"
"add" "add"
"text" "text"
] ]
[
"signs"
"add"
"numhl"
]
[
"signs"
"add"
"linehl"
]
[ [
"signs" "signs"
"add" "add"
"showCount" "showCount"
] ]
[
"signs"
"change"
"hl"
]
[ [
"signs" "signs"
"change" "change"
"text" "text"
] ]
[
"signs"
"change"
"numhl"
]
[
"signs"
"change"
"linehl"
]
[ [
"signs" "signs"
"change" "change"
"showCount" "showCount"
] ]
[
"signs"
"topdelete"
"hl"
]
[ [
"signs" "signs"
"topdelete" "topdelete"
"text" "text"
] ]
[
"signs"
"topdelete"
"numhl"
]
[
"signs"
"topdelete"
"linehl"
]
[ [
"signs" "signs"
"topdelete" "topdelete"
"showCount" "showCount"
] ]
[
"signs"
"changedelete"
"hl"
]
[ [
"signs" "signs"
"changedelete" "changedelete"
"text" "text"
] ]
[
"signs"
"changedelete"
"numhl"
]
[
"signs"
"changedelete"
"linehl"
]
[ [
"signs" "signs"
"changedelete" "changedelete"
"showCount" "showCount"
] ]
[
"signs"
"untracked"
"hl"
]
[ [
"signs" "signs"
"untracked" "untracked"
"text" "text"
] ]
[
"signs"
"untracked"
"numhl"
]
[
"signs"
"untracked"
"linehl"
]
[ [
"signs" "signs"
"untracked" "untracked"
@ -195,10 +120,6 @@ helpers.neovim-plugin.mkNeovimPlugin config {
"virtTextPriority" "virtTextPriority"
] ]
"trouble" "trouble"
[
"yadm"
"enable"
]
"wordDiff" "wordDiff"
"debugMode" "debugMode"
]; ];
@ -209,8 +130,41 @@ helpers.neovim-plugin.mkNeovimPlugin config {
"gitsigns" "gitsigns"
]; ];
settingsPath = basePluginPaths ++ [ "settings" ]; 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 in
[ (map (
{ optionPath, hlg }:
helpers.mkDeprecatedSubOptionModule optionPath "Please define the `${hlg}` highlight group instead."
) highlightRemovals)
++ [
(mkRenamedOptionModule ( (mkRenamedOptionModule (
basePluginPaths basePluginPaths
++ [ ++ [
@ -278,6 +232,13 @@ helpers.neovim-plugin.mkNeovimPlugin config {
"nonCommitted" "nonCommitted"
] ]
) (settingsPath ++ [ "current_line_blame_formatter_nc" ])) ) (settingsPath ++ [ "current_line_blame_formatter_nc" ]))
(helpers.mkDeprecatedSubOptionModule (
settingsPath
++ [
"yadm"
"enable"
]
) "yadm support was removed upstream.")
]; ];
extraOptions = { extraOptions = {

View file

@ -3,28 +3,11 @@ with lib;
{ {
signs = signs =
let 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: { signOptions = defaults: {
hl = helpers.defaultNullOpts.mkStr defaults.hl ''
**DEPRECATED**
Specifies the highlight group to use for the sign.
'';
text = helpers.defaultNullOpts.mkStr defaults.text '' text = helpers.defaultNullOpts.mkStr defaults.text ''
Specifies the character to use for the sign. 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 '' show_count = helpers.defaultNullOpts.mkBool false ''
Showing count of hunk, e.g. number of deleted lines. Showing count of hunk, e.g. number of deleted lines.
''; '';
@ -422,15 +405,6 @@ with lib;
Default: `pcall(require, 'trouble')` 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 '' word_diff = helpers.defaultNullOpts.mkBool false ''
Highlight intra-line word differences in the buffer. Highlight intra-line word differences in the buffer.
Requires `config.diff_opts.internal = true`. Requires `config.diff_opts.internal = true`.