Skip to content

Commit 2a4bd00

Browse files
committed
patch 8.2.3240: Lua print() does not work properly
Problem: Lua print() does not work properly. Solution: Put back lua_pop().
1 parent 81530e3 commit 2a4bd00

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/if_lua.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,7 @@ luaV_print(lua_State *L)
17371737
if (i > 1)
17381738
luaL_addchar(&b, ' '); // use space instead of tab
17391739
luaV_addlstring(&b, s, l, 0);
1740+
lua_pop(L, 1);
17401741
}
17411742
luaL_pushresult(&b);
17421743
if (!got_int)

src/testdir/test_lua.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,8 @@ endfunc
870870

871871
" Test for dealing with strings containing newlines and null character
872872
func Test_lua_string_with_newline()
873-
let x = execute('lua print("Hello\nWorld")')
874-
call assert_equal("\nHello\nWorld", x)
873+
let x = execute('lua print("Hello\nWorld", 2)')
874+
call assert_equal("\nHello\nWorld 2", x)
875875
new
876876
lua k = vim.buffer(vim.eval('bufnr()'))
877877
lua k:insert("Hello\0World", 0)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3240,
758760
/**/
759761
3239,
760762
/**/

0 commit comments

Comments
 (0)