mirror of
https://github.com/neovim/neovim.git
synced 2026-05-26 14:58:28 +00:00
feat(eval): treat Lua string as "blob" in writefile() #39098
Problem: vim.fn.writefile() treats Lua strings as Vimscript strings instead of a "binary clean" string. Solution: Treat Lua-originated strings as blob data.
This commit is contained in:
@@ -1366,12 +1366,14 @@ int nlua_call(lua_State *lstate)
|
||||
funcexe.fe_firstline = curwin->w_cursor.lnum;
|
||||
funcexe.fe_lastline = curwin->w_cursor.lnum;
|
||||
funcexe.fe_evaluate = true;
|
||||
const sctx_T save_current_sctx = api_set_sctx(LUA_INTERNAL_CALL);
|
||||
|
||||
TRY_WRAP(&err, {
|
||||
// call_func() retval is deceptive, ignore it. Instead we set `msg_list`
|
||||
// (TRY_WRAP) to capture abort-causing non-exception errors.
|
||||
(void)call_func(name, (int)name_len, &rettv, nargs, vim_args, &funcexe);
|
||||
});
|
||||
current_sctx = save_current_sctx;
|
||||
|
||||
if (!ERROR_SET(&err)) {
|
||||
nlua_push_typval(lstate, &rettv, 0);
|
||||
|
||||
Reference in New Issue
Block a user