diff options
author | James McCoy <jamessan@jamessan.com> | 2021-10-18 09:08:46 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2021-11-01 06:41:28 -0400 |
commit | efa924f66b183d9cf2404ce91c4f009c27e0515a (patch) | |
tree | adc8c74cba88e76c2ae0548cd6e9b01804da9933 /src/nvim/lua/converter.c | |
parent | 684640f5518a483cf2bc48efc8f68449379cef69 (diff) | |
download | rneovim-efa924f66b183d9cf2404ce91c4f009c27e0515a.tar.gz rneovim-efa924f66b183d9cf2404ce91c4f009c27e0515a.tar.bz2 rneovim-efa924f66b183d9cf2404ce91c4f009c27e0515a.zip |
vim-patch:8.1.0743: giving error messages is not flexible
Problem: Giving error messages is not flexible.
Solution: Add semsg(). Change argument from "char_u *" to "char *", also
for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of
an enormous number of type casts.
https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
Diffstat (limited to 'src/nvim/lua/converter.c')
-rw-r--r-- | src/nvim/lua/converter.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c index ca3c4f604a..9f2372f831 100644 --- a/src/nvim/lua/converter.c +++ b/src/nvim/lua/converter.c @@ -62,7 +62,7 @@ static LuaTableProps nlua_traverse_table(lua_State *const lstate) LuaTableProps ret; memset(&ret, 0, sizeof(ret)); if (!lua_checkstack(lstate, lua_gettop(lstate) + 3)) { - emsgf(_("E1502: Lua failed to grow stack to %i"), lua_gettop(lstate) + 2); + semsg(_("E1502: Lua failed to grow stack to %i"), lua_gettop(lstate) + 2); ret.type = kObjectTypeNil; return ret; } @@ -198,7 +198,7 @@ bool nlua_pop_typval(lua_State *lstate, typval_T *ret_tv) kvi_push(stack, ((TVPopStackItem) { ret_tv, false, false, 0 })); while (ret && kv_size(stack)) { if (!lua_checkstack(lstate, lua_gettop(lstate) + 3)) { - emsgf(_("E1502: Lua failed to grow stack to %i"), lua_gettop(lstate) + 3); + semsg(_("E1502: Lua failed to grow stack to %i"), lua_gettop(lstate) + 3); ret = false; break; } @@ -376,7 +376,7 @@ bool nlua_pop_typval(lua_State *lstate, typval_T *ret_tv) cur.tv->vval.v_float = (float_T)table_props.val; break; case kObjectTypeNil: - EMSG(_("E5100: Cannot convert given lua table: table " + emsg(_("E5100: Cannot convert given lua table: table " "should either have a sequence of positive integer keys " "or contain only string keys")); ret = false; @@ -408,13 +408,13 @@ nlua_pop_typval_table_processing_end: cur.tv->v_type = VAR_SPECIAL; cur.tv->vval.v_special = kSpecialVarNull; } else { - EMSG(_("E5101: Cannot convert given lua type")); + emsg(_("E5101: Cannot convert given lua type")); ret = false; } break; } default: - EMSG(_("E5101: Cannot convert given lua type")); + emsg(_("E5101: Cannot convert given lua type")); ret = false; break; } @@ -503,7 +503,7 @@ static bool typval_conv_special = false; #define TYPVAL_ENCODE_CONV_LIST_START(tv, len) \ do { \ if (!lua_checkstack(lstate, lua_gettop(lstate) + 3)) { \ - emsgf(_("E5102: Lua failed to grow stack to %i"), \ + semsg(_("E5102: Lua failed to grow stack to %i"), \ lua_gettop(lstate) + 3); \ return false; \ } \ @@ -526,7 +526,7 @@ static bool typval_conv_special = false; #define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len) \ do { \ if (!lua_checkstack(lstate, lua_gettop(lstate) + 3)) { \ - emsgf(_("E5102: Lua failed to grow stack to %i"), \ + semsg(_("E5102: Lua failed to grow stack to %i"), \ lua_gettop(lstate) + 3); \ return false; \ } \ @@ -614,7 +614,7 @@ bool nlua_push_typval(lua_State *lstate, typval_T *const tv, bool special) const int initial_size = lua_gettop(lstate); if (!lua_checkstack(lstate, initial_size + 2)) { - emsgf(_("E1502: Lua failed to grow stack to %i"), initial_size + 4); + semsg(_("E1502: Lua failed to grow stack to %i"), initial_size + 4); return false; } if (encode_vim_to_lua(lstate, tv, "nlua_push_typval argument") == FAIL) { |