diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2022-08-07 16:01:34 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2022-08-07 16:01:34 -0600 |
commit | a5f27a311fb28797a72b8aa16ec7122c5a1b15e4 (patch) | |
tree | 3732f7339e29431f31310aef6ffc802cf4f6255d /src/nvim/api/command.c | |
parent | 6c909fedc924d9f4257aa204b0168c6177cc5d28 (diff) | |
parent | 629169462a82f0fbb7a8911a4554894537d6776c (diff) | |
download | rneovim-a5f27a311fb28797a72b8aa16ec7122c5a1b15e4.tar.gz rneovim-a5f27a311fb28797a72b8aa16ec7122c5a1b15e4.tar.bz2 rneovim-a5f27a311fb28797a72b8aa16ec7122c5a1b15e4.zip |
Merge branch 'master' of https://github.com/neovim/neovim into rahm
Diffstat (limited to 'src/nvim/api/command.c')
-rw-r--r-- | src/nvim/api/command.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/api/command.c b/src/nvim/api/command.c index 33efa6b326..bc766ff39c 100644 --- a/src/nvim/api/command.c +++ b/src/nvim/api/command.c @@ -14,6 +14,7 @@ #include "nvim/lua/executor.h" #include "nvim/ops.h" #include "nvim/regexp.h" +#include "nvim/usercmd.h" #include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS @@ -505,6 +506,11 @@ String nvim_cmd(uint64_t channel_id, Dict(cmd) *cmd, Dict(cmd_opts) *opts, Error OBJ_TO_BOOL(cmdinfo.magic.file, magic.file, ea.argt & EX_XFILE, "'magic.file'"); OBJ_TO_BOOL(cmdinfo.magic.bar, magic.bar, ea.argt & EX_TRLBAR, "'magic.bar'"); + if (cmdinfo.magic.file) { + ea.argt |= EX_XFILE; + } else { + ea.argt &= ~EX_XFILE; + } } else { cmdinfo.magic.file = ea.argt & EX_XFILE; cmdinfo.magic.bar = ea.argt & EX_TRLBAR; @@ -939,7 +945,7 @@ void create_user_command(String name, Object command, Dict(user_command) *opts, cmd_addr_T addr_type_arg = ADDR_NONE; int compl = EXPAND_NOTHING; char *compl_arg = NULL; - char *rep = NULL; + const char *rep = NULL; LuaRef luaref = LUA_NOREF; LuaRef compl_luaref = LUA_NOREF; LuaRef preview_luaref = LUA_NOREF; @@ -1111,8 +1117,7 @@ void create_user_command(String name, Object command, Dict(user_command) *opts, if (opts->desc.type == kObjectTypeString) { rep = opts->desc.data.string.data; } else { - snprintf((char *)IObuff, IOSIZE, "<Lua function %d>", luaref); - rep = (char *)IObuff; + rep = ""; } break; case kObjectTypeString: |