Skip to content

Commit

Permalink
if_lua: Fix coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
k-takata committed Jul 5, 2018
1 parent f3dc235 commit 856aeb0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/if_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,8 @@ luaV_dict_newindex(lua_State *L)
luaL_error(L, "dict is locked");
if (key != NULL && *key == NUL)
luaL_error(L, "empty key");
if (!lua_isnil(L, 3)) { /* read value? */
if (!lua_isnil(L, 3)) /* read value? */
{
luaV_checktypval(L, 3, &v, "setting dict item");
if (d->dv_scope == VAR_DEF_SCOPE && v.v_type == VAR_FUNC)
luaL_error(L, "cannot assign funcref to builtin scope");
Expand Down Expand Up @@ -1066,7 +1067,8 @@ luaV_funcref_call(lua_State *L)

f->args.vval.v_list = list_alloc();
rettv.v_type = VAR_UNKNOWN; /* as in clear_tv */
for (i = 0; i < n; i++) {
for (i = 0; i < n; i++)
{
luaV_checktypval(L, i + 2, &v, "calling funcref");
list_append_tv(f->args.vval.v_list, &v);
}
Expand Down Expand Up @@ -1519,13 +1521,16 @@ luaV_list(lua_State *L)
else
{
luaV_newlist(L, l);
if (initarg) { /* traverse table to init dict */
if (initarg) /* traverse table to init list */
{
int notnil, i = 0;
typval_T v;
do {
do
{
lua_rawgeti(L, 1, ++i);
notnil = !lua_isnil(L, -1);
if (notnil) {
if (notnil)
{
luaV_checktypval(L, -1, &v, "vim.list");
list_append_tv(l, &v);
}
Expand Down Expand Up @@ -1564,7 +1569,8 @@ luaV_dict(lua_State *L)
luaL_error(L, "table has empty key");
luaV_checktypval(L, -2, &v, "vim.dict"); /* value */
di = dictitem_alloc(key);
if (di == NULL || dict_add(d, di) == FAIL) {
if (di == NULL || dict_add(d, di) == FAIL)
{
vim_free(di);
lua_pushnil(L);
return 1;
Expand Down

0 comments on commit 856aeb0

Please sign in to comment.