New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: nvim_ex_call_luaref #13280
base: master
Are you sure you want to change the base?
api: nvim_ex_call_luaref #13280
Conversation
I think yes. |
emsg_silent = true; | ||
} | ||
|
||
// Undefined behavior if you call vim.wait inside of here?... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why Undefined behavior? the same situation can already arise in vimscript with ex command modiifers
char_u *save_eventignore; | ||
if (!do_autocmds) { | ||
save_eventignore = vim_strsave(p_ei); | ||
set_string_option_direct( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this really how ex commands do it?
} | ||
|
||
// Undefined behavior if you call vim.wait inside of here?... | ||
Object rv = nlua_call_ref(cb, NULL, args, true, err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self, add a flag to nlua_call_ref
to preserve retval as a luaref (and also use it for nvim_buf_call
.
/// local wrapped = vim. | ||
// | ||
// nvim_ex_call_function({bufdo = {1, 3, 7, 8}}, my_lua_cb, ...) | ||
Object nvim_ex_call_luaref(Dictionary opts, LuaRef cb, Array args, Error *err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can just be called nvim_ex_call
or something without "lua" in the name.. The documentation will automatically indicate that it is "lua only" for now, and we can extend it later to rpc and/or vimscript.
@bfredl what do you think about the general idea?