Skip to content

Commit

Permalink
git/gitsigns: migrate to setupOpts (#524)
Browse files Browse the repository at this point in the history
* git/gitsigns: add `setupOpts` module option for user-specified setup table

* docs: update v0.8 release notes
  • Loading branch information
NotAShelf authored Jan 6, 2025
1 parent b7bea89 commit 9888a27
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/release-notes/rl-0.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- Add [render-markdown.nvim] under
`languages.markdown.extensions.render-markdown-nvim`

- Implement [](#opt-vim.git.gitsigns.setupOpts) for user-specified setup table
in gitsigns configuration.

[amadaluzia](https://github.com/amadaluzia):

[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
Expand Down
3 changes: 2 additions & 1 deletion modules/plugins/git/gitsigns/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetExprBinding mkSetLuaBinding pushDownDefault;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;

cfg = config.vim.git.gitsigns;

Expand Down Expand Up @@ -70,7 +71,7 @@ in {
};

pluginRC.gitsigns = entryAnywhere ''
require('gitsigns').setup{}
require('gitsigns').setup(${toLuaObject cfg.setupOpts})
'';
};
}
Expand Down
2 changes: 2 additions & 0 deletions modules/plugins/git/gitsigns/gitsigns.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.nvim.binds) mkMappingOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
imports = [
(mkRenamedOptionModule ["vim" "git" "gitsigns" "codeActions" "vim" "gitsigns" "codeActions"] ["vim" "git" "gitsigns" "codeActions" "enable"])
];

options.vim.git.gitsigns = {
enable = mkEnableOption "gitsigns" // {default = config.vim.git.enable;};
setupOpts = mkPluginSetupOption "gitsigns" {};

codeActions.enable = mkEnableOption "gitsigns codeactions through null-ls";

Expand Down

0 comments on commit 9888a27

Please sign in to comment.