From 1a6275850f851fc6d797dce07c819858f971d4dd Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 23 Jun 2024 16:26:20 +0200 Subject: [PATCH] plugins.gitsigns: remove deprecated options https://github.com/lewis6991/gitsigns.nvim/issues/453 --- plugins/git/gitsigns/options.nix | 66 +++------------------ tests/test-sources/plugins/git/gitsigns.nix | 42 ++----------- 2 files changed, 14 insertions(+), 94 deletions(-) diff --git a/plugins/git/gitsigns/options.nix b/plugins/git/gitsigns/options.nix index ebc4e3c20b..3918809e78 100644 --- a/plugins/git/gitsigns/options.nix +++ b/plugins/git/gitsigns/options.nix @@ -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 = @@ -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. @@ -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`. diff --git a/tests/test-sources/plugins/git/gitsigns.nix b/tests/test-sources/plugins/git/gitsigns.nix index 9694b40598..53894f6c2d 100644 --- a/tests/test-sources/plugins/git/gitsigns.nix +++ b/tests/test-sources/plugins/git/gitsigns.nix @@ -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 = [ {