Skip to content

Commit 7ac283f

Browse files
committed
plugins/gitsigns: remove deprecated options
1 parent 54d1188 commit 7ac283f

File tree

2 files changed

+41
-106
lines changed

2 files changed

+41
-106
lines changed

plugins/git/gitsigns/default.nix

Lines changed: 41 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -16,126 +16,51 @@ helpers.neovim-plugin.mkNeovimPlugin config {
1616
# TODO: introduced 2024-03-12, remove on 2024-05-12
1717
deprecateExtraOptions = true;
1818
optionsRenamedToSettings = [
19-
[
20-
"signs"
21-
"add"
22-
"hl"
23-
]
2419
[
2520
"signs"
2621
"add"
2722
"text"
2823
]
29-
[
30-
"signs"
31-
"add"
32-
"numhl"
33-
]
34-
[
35-
"signs"
36-
"add"
37-
"linehl"
38-
]
3924
[
4025
"signs"
4126
"add"
4227
"showCount"
4328
]
44-
[
45-
"signs"
46-
"change"
47-
"hl"
48-
]
4929
[
5030
"signs"
5131
"change"
5232
"text"
5333
]
54-
[
55-
"signs"
56-
"change"
57-
"numhl"
58-
]
59-
[
60-
"signs"
61-
"change"
62-
"linehl"
63-
]
6434
[
6535
"signs"
6636
"change"
6737
"showCount"
6838
]
69-
[
70-
"signs"
71-
"topdelete"
72-
"hl"
73-
]
7439
[
7540
"signs"
7641
"topdelete"
7742
"text"
7843
]
79-
[
80-
"signs"
81-
"topdelete"
82-
"numhl"
83-
]
84-
[
85-
"signs"
86-
"topdelete"
87-
"linehl"
88-
]
8944
[
9045
"signs"
9146
"topdelete"
9247
"showCount"
9348
]
94-
[
95-
"signs"
96-
"changedelete"
97-
"hl"
98-
]
9949
[
10050
"signs"
10151
"changedelete"
10252
"text"
10353
]
104-
[
105-
"signs"
106-
"changedelete"
107-
"numhl"
108-
]
109-
[
110-
"signs"
111-
"changedelete"
112-
"linehl"
113-
]
11454
[
11555
"signs"
11656
"changedelete"
11757
"showCount"
11858
]
119-
[
120-
"signs"
121-
"untracked"
122-
"hl"
123-
]
12459
[
12560
"signs"
12661
"untracked"
12762
"text"
12863
]
129-
[
130-
"signs"
131-
"untracked"
132-
"numhl"
133-
]
134-
[
135-
"signs"
136-
"untracked"
137-
"linehl"
138-
]
13964
[
14065
"signs"
14166
"untracked"
@@ -195,10 +120,6 @@ helpers.neovim-plugin.mkNeovimPlugin config {
195120
"virtTextPriority"
196121
]
197122
"trouble"
198-
[
199-
"yadm"
200-
"enable"
201-
]
202123
"wordDiff"
203124
"debugMode"
204125
];
@@ -209,8 +130,41 @@ helpers.neovim-plugin.mkNeovimPlugin config {
209130
"gitsigns"
210131
];
211132
settingsPath = basePluginPaths ++ [ "settings" ];
133+
134+
highlights = {
135+
add = "Add";
136+
change = "Change";
137+
delete = "Delete";
138+
topdelete = "Topdelete";
139+
changedelete = "Changedelete";
140+
untracked = "Untracked";
141+
};
142+
143+
subHighlights = {
144+
hl = "";
145+
linehl = "Ln";
146+
numhl = "Nr";
147+
};
148+
149+
highlightRemovals = flatten (
150+
mapAttrsToList (
151+
opt: hlg:
152+
mapAttrsToList (subOpt: subHlg: {
153+
optionPath = settingsPath ++ [
154+
"signs"
155+
opt
156+
subOpt
157+
];
158+
hlg = "GitSigns${hlg}${subHlg}";
159+
}) subHighlights
160+
) highlights
161+
);
212162
in
213-
[
163+
(map (
164+
{ optionPath, hlg }:
165+
helpers.mkDeprecatedSubOptionModule optionPath "Please define the `${hlg}` highlight group instead."
166+
) highlightRemovals)
167+
++ [
214168
(mkRenamedOptionModule (
215169
basePluginPaths
216170
++ [
@@ -278,6 +232,13 @@ helpers.neovim-plugin.mkNeovimPlugin config {
278232
"nonCommitted"
279233
]
280234
) (settingsPath ++ [ "current_line_blame_formatter_nc" ]))
235+
(helpers.mkDeprecatedSubOptionModule (
236+
settingsPath
237+
++ [
238+
"yadm"
239+
"enable"
240+
]
241+
) "yadm support was removed upstream.")
281242
];
282243

283244
extraOptions = {

plugins/git/gitsigns/options.nix

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,11 @@ with lib;
33
{
44
signs =
55
let
6-
# TODO (2024-06-24): find a way to properly remove the `hl`, `numhl` and `linehl` options
7-
# https://github.com/lewis6991/gitsigns.nvim/issues/453#issuecomment-2178736570
86
signOptions = defaults: {
9-
hl = helpers.defaultNullOpts.mkStr defaults.hl ''
10-
**DEPRECATED**
11-
Specifies the highlight group to use for the sign.
12-
'';
13-
147
text = helpers.defaultNullOpts.mkStr defaults.text ''
158
Specifies the character to use for the sign.
169
'';
1710

18-
numhl = helpers.defaultNullOpts.mkStr defaults.numhl ''
19-
**DEPRECATED**
20-
Specifies the highlight group to use for the number column.
21-
'';
22-
23-
linehl = helpers.defaultNullOpts.mkStr defaults.linehl ''
24-
**DEPRECATED**
25-
Specifies the highlight group to use for the line.
26-
'';
27-
2811
show_count = helpers.defaultNullOpts.mkBool false ''
2912
Showing count of hunk, e.g. number of deleted lines.
3013
'';
@@ -422,15 +405,6 @@ with lib;
422405
Default: `pcall(require, 'trouble')`
423406
'';
424407

425-
yadm = {
426-
# TODO (2024-06-24): find a way to properly remove this option
427-
# https://github.com/lewis6991/gitsigns.nvim/issues/453#issuecomment-2178743878
428-
enable = helpers.defaultNullOpts.mkBool false ''
429-
**DEPRECATED**
430-
Enable YADM support.
431-
'';
432-
};
433-
434408
word_diff = helpers.defaultNullOpts.mkBool false ''
435409
Highlight intra-line word differences in the buffer.
436410
Requires `config.diff_opts.internal = true`.

0 commit comments

Comments
 (0)