Skip to content

Commit

Permalink
modules/commands: fix lua cmd.options value when no options are set
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Jan 20, 2024
1 parent c5143dc commit c97afcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/commands.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';
};
Expand Down
3 changes: 3 additions & 0 deletions tests/test-sources/modules/commands.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
command = ":w<CR>";
desc = "Write file";
};
"Z" = {
command = ":echo fooo<CR>";
};
};
};
}

0 comments on commit c97afcb

Please sign in to comment.