tui/input: defer nvim_paste properly.

Otherwise cursor and redraw code for normal and insert mode will not run. The
"tickle" workaround was used for this instead, and can now be removed.

The builtin vim.lua got the name
[string "-- Nvim-Lua stdlib: thevimmodule (:help l..."]
in error messages. Fix it to something reasonable.
This commit is contained in:
Björn Linse
2019-08-29 12:16:31 +02:00
parent 8a03acb8da
commit 7a85792884
4 changed files with 58 additions and 17 deletions

View File

@@ -269,7 +269,9 @@ static int nlua_state_init(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL
#endif
// vim
if (luaL_dostring(lstate, (char *)&vim_module[0])) {
const char *code = (char *)&vim_module[0];
if (luaL_loadbuffer(lstate, code, strlen(code), "@vim.lua")
|| lua_pcall(lstate, 0, LUA_MULTRET, 0)) {
nlua_error(lstate, _("E5106: Error while creating vim module: %.*s"));
return 1;
}