From 7a857928842476bce8c9bed7cf549fc76c4e6489 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 29 Aug 2019 12:16:31 +0200 Subject: 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. --- src/nvim/lua/executor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nvim/lua/executor.c') diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 3de1b531e6..f51aa3c6d4 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -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; } -- cgit