git/gitsigns: migrate to setupOpts (#524)

* git/gitsigns: add `setupOpts` module option for user-specified setup table

* docs: update v0.8 release notes
This commit is contained in:
raf 2025-01-06 03:54:38 +03:00 committed by GitHub
parent b7bea89d9a
commit 9888a277ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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;
@ -70,7 +71,7 @@ in {
};
pluginRC.gitsigns = entryAnywhere ''
require('gitsigns').setup{}
require('gitsigns').setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -6,6 +6,7 @@
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"])
@ -13,6 +14,7 @@ in {
options.vim.git.gitsigns = {
enable = mkEnableOption "gitsigns" // {default = config.vim.git.enable;};
setupOpts = mkPluginSetupOption "gitsigns" {};
codeActions.enable = mkEnableOption "gitsigns codeactions through null-ls";