lib/neovim-plugin: freeform lazy settings

Instead of trying to manage upstream configuration options, just keep
using our freeform options so we can do less finicky logic and
workarounds.
This commit is contained in:
Austin Horstman 2024-12-05 21:58:33 -06:00
parent d24dd313cf
commit 0997b371c7
No known key found for this signature in database
3 changed files with 103 additions and 118 deletions

View file

@ -178,20 +178,14 @@
(
{
__unkeyed-1 = originalName;
# Use provided after, otherwise fallback to normal lua content
# Use provided after, otherwise fallback to normal function wrapped lua content
after =
if cfg.lazyLoad.settings.after != null then
cfg.lazyLoad.settings.after
else
# We need to wrap it in a function so it doesn't execute immediately
"function()\n " + cfg.luaConfig.content + " \nend";
colorscheme =
if cfg.lazyLoad.settings.colorscheme != null then
cfg.lazyLoad.settings.colorscheme
else if (isColorscheme && colorscheme != null) then
colorscheme
else
null;
let
after = cfg.lazyLoad.settings.after or null;
default = "function()\n " + cfg.luaConfig.content + " \nend";
in
if (lib.isString after || lib.types.rawLua.check after) then after else default;
colorscheme = lib.mkIf isColorscheme (cfg.lazyLoad.settings.colorscheme or colorscheme);
}
// lib.removeAttrs cfg.lazyLoad.settings [
"after"