aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/command.c
diff options
context:
space:
mode:
authorii14 <59243201+ii14@users.noreply.github.com>2023-04-06 22:39:50 +0200
committerGitHub <noreply@github.com>2023-04-06 22:39:50 +0200
commit7190dba017e3aac0409c73ff1c954d18858cb3c9 (patch)
tree321f4b2dd65e4a06047beee876d3c2e0d2dbf7d0 /src/nvim/api/command.c
parent0bc323850410df4c3c1dd8fabded9d2000189270 (diff)
downloadrneovim-7190dba017e3aac0409c73ff1c954d18858cb3c9.tar.gz
rneovim-7190dba017e3aac0409c73ff1c954d18858cb3c9.tar.bz2
rneovim-7190dba017e3aac0409c73ff1c954d18858cb3c9.zip
refactor: remove use of reserved c++ keywords
libnvim couldn't be easily used in C++ due to the use of reserved keywords. Additionally, add explicit casts to *alloc function calls used in inline functions, as C++ doesn't allow implicit casts from void pointers.
Diffstat (limited to 'src/nvim/api/command.c')
-rw-r--r--src/nvim/api/command.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/api/command.c b/src/nvim/api/command.c
index 26ee9205b2..7c01dc0e54 100644
--- a/src/nvim/api/command.c
+++ b/src/nvim/api/command.c
@@ -1015,7 +1015,7 @@ void create_user_command(uint64_t channel_id, String name, Object command, Dict(
uint32_t argt = 0;
int64_t def = -1;
cmd_addr_T addr_type_arg = ADDR_NONE;
- int compl = EXPAND_NOTHING;
+ int context = EXPAND_NOTHING;
char *compl_arg = NULL;
const char *rep = NULL;
LuaRef luaref = LUA_NOREF;
@@ -1161,11 +1161,11 @@ void create_user_command(uint64_t channel_id, String name, Object command, Dict(
}
if (opts->complete.type == kObjectTypeLuaRef) {
- compl = EXPAND_USER_LUA;
+ context = EXPAND_USER_LUA;
compl_luaref = api_new_luaref(opts->complete.data.luaref);
} else if (opts->complete.type == kObjectTypeString) {
VALIDATE_S(OK == parse_compl_arg(opts->complete.data.string.data,
- (int)opts->complete.data.string.size, &compl, &argt,
+ (int)opts->complete.data.string.size, &context, &argt,
&compl_arg),
"complete", opts->complete.data.string.data, {
goto err;
@@ -1204,8 +1204,8 @@ void create_user_command(uint64_t channel_id, String name, Object command, Dict(
}
WITH_SCRIPT_CONTEXT(channel_id, {
- if (uc_add_command(name.data, name.size, rep, argt, def, flags, compl, compl_arg, compl_luaref,
- preview_luaref, addr_type_arg, luaref, force) != OK) {
+ if (uc_add_command(name.data, name.size, rep, argt, def, flags, context, compl_arg,
+ compl_luaref, preview_luaref, addr_type_arg, luaref, force) != OK) {
api_set_error(err, kErrorTypeException, "Failed to create user command");
// Do not goto err, since uc_add_command now owns luaref, compl_luaref, and compl_arg
}