From 67abc51902826c802a1a77961422b5e18c6f8e44 Mon Sep 17 00:00:00 2001 From: diniamo <55629891+diniamo@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:06:24 +0200 Subject: [PATCH] treewide: remove the theme section from the DAG order dependance (#369) * treewide: remove the theme section from the DAG order dependance * docs/dag-entries: correct theme entry note --- docs/manual/configuring/dag-entries.md | 2 +- modules/plugins/theme/theme.nix | 4 ++-- modules/wrapper/rc/config.nix | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/manual/configuring/dag-entries.md b/docs/manual/configuring/dag-entries.md index 5f4f4f6..d5afa9b 100644 --- a/docs/manual/configuring/dag-entries.md +++ b/docs/manual/configuring/dag-entries.md @@ -11,7 +11,7 @@ entries in nvf: inserted before the rest of the DAG 2. `globalsScript` - used to set globals defined in `vim.globals` 3. `basic` - used to set basic configuration options -4. `theme` - used to set up the theme, which has to be done before other plugins +4. `theme` (this is simply placed before `pluginConfigs`, meaning that surrounding entries don't depend on it) - used to set up the theme, which has to be done before other plugins 5. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option, see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your own plugins) DAG, used to set up internal plugins diff --git a/modules/plugins/theme/theme.nix b/modules/plugins/theme/theme.nix index bcc476b..85f8430 100644 --- a/modules/plugins/theme/theme.nix +++ b/modules/plugins/theme/theme.nix @@ -7,7 +7,7 @@ inherit (lib.attrsets) attrNames; inherit (lib.types) bool lines enum; inherit (lib.modules) mkIf; - inherit (lib.nvim.dag) entryAfter; + inherit (lib.nvim.dag) entryBefore; cfg = config.vim.theme; supportedThemes = import ./supported-themes.nix { @@ -45,7 +45,7 @@ in { config = mkIf cfg.enable { vim = { startPlugins = [cfg.name]; - luaConfigRC.theme = entryAfter ["basic"] '' + luaConfigRC.theme = entryBefore ["pluginConfigs"] '' ${cfg.extraConfig} ${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}} ''; diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index 78edb59..8ebf1c2 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -133,8 +133,8 @@ in { vim = { luaConfigRC = { globalsScript = entryAnywhere (concatLines globalsScript); - # basic, theme - pluginConfigs = entryAfter ["theme"] pluginConfigs; + # basic + pluginConfigs = entryAfter ["basic"] pluginConfigs; extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs; mappings = entryAfter ["extraPluginConfigs"] mappings; };