Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tjdevries
Copy link
Contributor

@bfredl what do you think about the general idea?

@bfredl
Copy link
Member

bfredl commented Nov 13, 2020

I think yes.

emsg_silent = true;
}

// Undefined behavior if you call vim.wait inside of here?...
Copy link
Member

@bfredl bfredl Nov 13, 2020

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(
Copy link
Member

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);
Copy link
Member

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)
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api libnvim, Nvim RPC API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants