diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-10-27 15:26:32 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-10-29 22:39:07 -0700 |
commit | efaf4732e26e2f0fbfab947296141376223b30d7 (patch) | |
tree | a194f621b9d4cff6ce75af11fd7a689f8fb0a567 /src/nvim/lua/executor.c | |
parent | 83b6d9f197a44e3b8140619e6b7e9950f217aafb (diff) | |
download | rneovim-efaf4732e26e2f0fbfab947296141376223b30d7.tar.gz rneovim-efaf4732e26e2f0fbfab947296141376223b30d7.tar.bz2 rneovim-efaf4732e26e2f0fbfab947296141376223b30d7.zip |
lua/executor.c: use TRY_WRAP
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index b7c1d57964..c7ff163f83 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -563,11 +563,8 @@ int nlua_call(lua_State *lstate) } } + TRY_WRAP({ // TODO(bfredl): this should be simplified in error handling refactor - struct msglist **saved_msg_list = msg_list; - struct msglist *private_msg_list = NULL; - msg_list = &private_msg_list; - force_abort = false; suppress_errthrow = false; current_exception = NULL; @@ -577,7 +574,7 @@ int nlua_call(lua_State *lstate) typval_T rettv; int dummy; // call_func() retval is deceptive, ignore it. Instead we set `msg_list` - // (see above) to capture abort-causing non-exception errors. + // (TRY_WRAP) to capture abort-causing non-exception errors. (void)call_func(name, (int)name_len, &rettv, nargs, vim_args, NULL, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &dummy, true, NULL, NULL); @@ -585,8 +582,7 @@ int nlua_call(lua_State *lstate) nlua_push_typval(lstate, &rettv, false); } tv_clear(&rettv); - - msg_list = saved_msg_list; + }); free_vim_args: while (i > 0) { |