diff options
| author | Barrett Ruth <62671086+barrettruth@users.noreply.github.com> | 2026-04-22 13:36:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-22 13:36:43 -0400 |
| commit | fb6aeaba2d3a38c7febd0a39cabd89685de11b9d (patch) | |
| tree | 438f983b11642e476800f422651de39040db007d /src/nvim/lua/executor.c | |
| parent | 496374e9513a5cbd0fd37fbd95d07d6306fa432d (diff) | |
| download | rneovim-fb6aeaba2d3a38c7febd0a39cabd89685de11b9d.tar.gz rneovim-fb6aeaba2d3a38c7febd0a39cabd89685de11b9d.tar.bz2 rneovim-fb6aeaba2d3a38c7febd0a39cabd89685de11b9d.zip | |
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.
Diffstat (limited to 'src/nvim/lua/executor.c')
| -rw-r--r-- | src/nvim/lua/executor.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 1771a01565..02a95d5f6d 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -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); |