aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
diff options
context:
space:
mode:
authorShadman <13149513+shadmansaleh@users.noreply.github.com>2022-01-07 00:42:31 +0600
committerGitHub <noreply@github.com>2022-01-06 11:42:31 -0700
commit287d3566de11f82aa86448998fd4703b1db328bd (patch)
tree9fd586e31fc9058f499a4247c1c0efe72a64f55d /src/nvim/lua/executor.c
parentd78e46679d2ff31916091f9368367ccc1539c299 (diff)
downloadrneovim-287d3566de11f82aa86448998fd4703b1db328bd.tar.gz
rneovim-287d3566de11f82aa86448998fd4703b1db328bd.tar.bz2
rneovim-287d3566de11f82aa86448998fd4703b1db328bd.zip
fix(lua): print multiple return values with =expr (#16933)
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r--src/nvim/lua/executor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index c814974fe7..cfdbe7b344 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -1131,12 +1131,12 @@ void ex_lua(exarg_T *const eap)
}
// When =expr is used transform it to print(vim.inspect(expr))
if (code[0] == '=') {
- len += sizeof("print(vim.inspect())") - sizeof("=");
+ len += sizeof("vim.pretty_print()") - sizeof("=");
// code_buf needs to be 1 char larger then len for null byte in the end.
// lua nlua_typval_exec doesn't expect null terminated string so len
// needs to end before null byte.
char *code_buf = xmallocz(len);
- vim_snprintf(code_buf, len+1, "print(vim.inspect(%s))", code+1);
+ vim_snprintf(code_buf, len+1, "vim.pretty_print(%s)", code+1);
xfree(code);
code = code_buf;
}