autocmds: ensure augroups are set up before autocmds

This commit is contained in:
Ching Pei Yang 2025-09-25 23:49:41 +02:00
commit d26b9dc896
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -9,7 +9,7 @@
inherit (lib.types) nullOr submodule listOf str bool;
inherit (lib.nvim.types) luaInline;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAfter;
inherit (lib.nvim.dag) entryAfter entryBetween;
autocommandType = submodule {
options = {
@ -144,7 +144,7 @@ in {
enabledAutogroups = filter (au: au.enable) cfg.augroups;
in {
luaConfigRC = {
augroups = entryAfter ["pluginConfigs"] (optionalString (enabledAutogroups != []) ''
augroups = entryBetween ["autocmds"] ["pluginConfigs"] (optionalString (enabledAutogroups != []) ''
local nvf_autogroups = {}
for _, group in ipairs(${toLuaObject enabledAutogroups}) do
if group.name then