refactor: split WIN_EXECUTE() into two functions (#26627)

This commit is contained in:
zeertzjq
2023-12-18 09:05:59 +08:00
committed by GitHub
parent e164f4c271
commit 6abdc1ac1f
5 changed files with 90 additions and 68 deletions

View File

@@ -435,10 +435,12 @@ Object nvim_win_call(Window window, LuaRef fun, Error *err)
try_start();
Object res = OBJECT_INIT;
WIN_EXECUTE(win, tabpage, {
win_execute_T win_execute_args;
if (win_execute_before(&win_execute_args, win, tabpage)) {
Array args = ARRAY_DICT_INIT;
res = nlua_call_ref(fun, NULL, args, true, err);
});
}
win_execute_after(&win_execute_args);
try_end(err);
return res;
}