feat(api): add nvim_cmd

Adds the API function `nvim_cmd` which allows executing an Ex-command through a Dictionary which can have the same values as the return value of `nvim_parse_cmd()`. This makes it much easier to do things like passing arguments with a space to commands that otherwise may not allow it, or to make commands interpret certain characters literally when they otherwise would not.
This commit is contained in:
Famiu Haque
2022-05-08 17:39:45 +06:00
parent 77863b8e96
commit dfcc584665
10 changed files with 1131 additions and 132 deletions

View File

@@ -175,6 +175,9 @@ enum {
/// Arguments used for Ex commands.
struct exarg {
char *arg; ///< argument of the command
char **args; ///< starting position of command arguments
size_t *arglens; ///< length of command arguments
size_t argc; ///< number of command arguments
char *nextcmd; ///< next command (NULL if none)
char *cmd; ///< the name of the command (except for :make)
char **cmdlinep; ///< pointer to pointer of allocated cmdline