mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-11 07:55:31 +00:00
Altered mkEnableTreesitterOption functionallity to take in a boolean instead of all of config
This commit is contained in:
parent
cc5e7c9730
commit
91a3f67a9e
2 changed files with 7 additions and 5 deletions
|
|
@ -33,10 +33,10 @@
|
||||||
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
|
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
|
||||||
};
|
};
|
||||||
|
|
||||||
mkEnableTreesitterOption = config: language:
|
mkEnableTreesitterOption = defaultCondition: language:
|
||||||
mkOption {
|
mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.languages.enableTreesitter;
|
default = defaultCondition;
|
||||||
description = "Whether to enable ${language} treesitter";
|
description = "Whether to enable ${language} treesitter";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
|
||||||
|
|
@ -5,17 +5,19 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.types) mkGrammarOption mkEnableTreesitterOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
|
||||||
|
mkEnableTreesitterOption = lib.nvim.types.mkEnableTreesitterOption config.vim.languages.enableTreesitter;
|
||||||
|
|
||||||
cfg = config.vim.languages.tex;
|
cfg = config.vim.languages.tex;
|
||||||
in {
|
in {
|
||||||
options.vim.languages.tex.treesitter = {
|
options.vim.languages.tex.treesitter = {
|
||||||
latex = {
|
latex = {
|
||||||
enable = mkEnableTreesitterOption config "latex";
|
enable = mkEnableTreesitterOption "latex";
|
||||||
package = mkGrammarOption pkgs "latex";
|
package = mkGrammarOption pkgs "latex";
|
||||||
};
|
};
|
||||||
bibtex = {
|
bibtex = {
|
||||||
enable = mkEnableTreesitterOption config "bibtex";
|
enable = mkEnableTreesitterOption "bibtex";
|
||||||
package = mkGrammarOption pkgs "bibtex";
|
package = mkGrammarOption pkgs "bibtex";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue