modules/commands: fix lua cmd.options value when no options are set

This commit is contained in:
Gaetan Lepage 2024-01-20 14:45:30 +01:00 committed by Gaétan Lepage
parent c5143dc519
commit c97afcbf82
2 changed files with 4 additions and 1 deletions

View file

@ -54,7 +54,7 @@ in {
extraConfigLua = helpers.wrapDo ''
local cmds = ${helpers.toLuaObject (mapAttrs cleanupCommand config.userCommands)};
for name,cmd in pairs(cmds) do
vim.api.nvim_create_user_command(name, cmd.command, cmd.options)
vim.api.nvim_create_user_command(name, cmd.command, cmd.options or {})
end
'';
};

View file

@ -5,6 +5,9 @@
command = ":w<CR>";
desc = "Write file";
};
"Z" = {
command = ":echo fooo<CR>";
};
};
};
}