colorizer: revert setupOpts name changes

This commit is contained in:
Pei Yang Ching 2024-05-05 02:16:12 +02:00
parent 2c37513012
commit 2cec6178ab
2 changed files with 7 additions and 6 deletions

View file

@ -27,23 +27,24 @@
};
in {
imports = [
(mkRenamedOptionModule ["vim" "ui" "colorizer" "options"] ["vim" "ui" "colorizer" "setupOpts" "defaultOptions"])
(mkRenamedOptionModule ["vim" "ui" "colorizer" "filetypes"] ["vim" "ui" "colorizer" "setupOpts" "filetypes"])
(mkRenamedOptionModule ["vim" "ui" "colorizer" "setupOpts" "defaultOptions"] ["vim" "ui" "colorizer" "options"])
(mkRenamedOptionModule ["vim" "ui" "colorizer" "setupOpts" "filetypes"] ["vim" "ui" "colorizer" "filetypes"])
];
options.vim.ui.colorizer = {
enable = mkEnableOption "color highlighting [nvim-colorizer.lua]";
defaultOptions = mkOption {
# colorizer has a non-standard setup function (takes two args), so we're not using setupOpts
options = mkOption {
description = ''
Default options that apply to all filetypes. Filetype specific settings from
[filetypeSettings](#opt-vim.ui.colorizer.filetypeSettings) take precedence.
[filetypes](#opt-vim.ui.colorizer.filetypes) take precedence.
'';
default = {};
type = settingSubmodule;
};
filetypeOptions = mkOption {
filetypes = mkOption {
description = "Filetype specific settings";
default = {};
type = submodule {

View file

@ -15,7 +15,7 @@ in {
];
vim.luaConfigRC.colorizer = entryAnywhere ''
require('colorizer').setup(${toLuaObject cfg.filetypeOptions}, ${toLuaObject cfg.defaultOptions})
require('colorizer').setup(${toLuaObject cfg.filetypes}, ${toLuaObject cfg.options})
'';
};
}