Skip to content

Commit

Permalink
plugins.gitsigns: remove deprecated options
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Jun 23, 2024
1 parent 1ed6d7a commit 6aeea89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 97 deletions.
66 changes: 8 additions & 58 deletions plugins/git/gitsigns/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,23 @@ with lib;
{
signs =
let
signOptions = defaults: {
hl = helpers.defaultNullOpts.mkStr defaults.hl ''
Specifies the highlight group to use for the sign.
'';

text = helpers.defaultNullOpts.mkStr defaults.text ''
signOptions = textDefault: {
text = helpers.defaultNullOpts.mkStr textDefault ''
Specifies the character to use for the sign.
'';

numhl = helpers.defaultNullOpts.mkStr defaults.numhl ''
Specifies the highlight group to use for the number column.
'';

linehl = helpers.defaultNullOpts.mkStr defaults.linehl ''
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.
'';
};
in
{
add = signOptions {
hl = "GitSignsAdd";
text = "┃";
numhl = "GitSignsAddNr";
linehl = "GitSignsAddLn";
};
change = signOptions {
hl = "GitSignsChange";
text = "┃";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
delete = signOptions {
hl = "GitSignsDelete";
text = "▁";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
topdelete = signOptions {
hl = "GitSignsDelete";
text = "▔";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
changedelete = signOptions {
hl = "GitSignsChange";
text = "~";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
untracked = signOptions {
hl = "GitSignsAdd";
text = "┆";
numhl = "GitSignsAddNr";
linehl = "GitSignsAddLn";
};
add = signOptions "┃";
change = signOptions "┃";
delete = signOptions "▁";
topdelete = signOptions "▔";
changedelete = signOptions "~";
untracked = signOptions "┆";
};

worktrees =
Expand Down Expand Up @@ -398,8 +356,6 @@ with lib;
Note that the keys map onto the output of:
`git blame --line-porcelain`
- {opts} Passed directly from `settings.current_line_blame_formatter_opts`.
Return:
The result of this function is passed directly to the `opts.virt_text` field of
`|nvim_buf_set_extmark|` and thus must be a list of `[text, highlight]` tuples.
Expand All @@ -419,12 +375,6 @@ with lib;
Default: `pcall(require, 'trouble')`
'';

yadm = {
enable = helpers.defaultNullOpts.mkBool false ''
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
45 changes: 6 additions & 39 deletions tests/test-sources/plugins/git/gitsigns.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,12 @@

settings = {
signs = {
add = {
hl = "GitSignsAdd";
text = "┃";
numhl = "GitSignsAddNr";
linehl = "GitSignsAddLn";
};
change = {
hl = "GitSignsChange";
text = "┃";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
delete = {
hl = "GitSignsDelete";
text = "▁";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
topdelete = {
hl = "GitSignsDelete";
text = "▔";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
changedelete = {
hl = "GitSignsChange";
text = "~";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
untracked = {
hl = "GitSignsAdd";
text = "┆";
numhl = "GitSignsAddNr";
linehl = "GitSignsAddLn";
};
add.text = "┃";
change.text = "┃";
delete.text = "▁";
topdelete.text = "▔";
changedelete.text = "~";
untracked.text = "┆";
};
worktrees = [
{
Expand Down Expand Up @@ -133,9 +103,6 @@
current_line_blame_formatter = " <author>, <author_time> - <summary> ";
current_line_blame_formatter_nc = " <author>";
trouble = false;
yadm = {
enable = false;
};
word_diff = false;
debug_mode = false;
};
Expand Down

0 comments on commit 6aeea89

Please sign in to comment.