comparison src/testdir/test_lua.vim @ 20045:04ef2ccf2519 v8.2.0578

patch 8.2.0578: heredoc for interfaces does not support "trim" Commit: https://github.com/vim/vim/commit/6c2b7b8055b96463f78abb70f58c4c6d6d4b9d55 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 14 20:15:49 2020 +0200 patch 8.2.0578: heredoc for interfaces does not support "trim" Problem: Heredoc for interfaces does not support "trim". Solution: Update the script heredoc support to be same as the :let command. (Yegappan Lakshmanan, closes #5916)
author Bram Moolenaar <Bram@vim.org>
date Tue, 14 Apr 2020 20:30:05 +0200
parents 2a017e9dc6da
children 5f9c2c7d3d73
comparison
equal deleted inserted replaced
20044:a5dca21836a2 20045:04ef2ccf2519
595 func Test_lua_set_cursor() 595 func Test_lua_set_cursor()
596 " Check that setting the cursor position works. 596 " Check that setting the cursor position works.
597 new 597 new
598 call setline(1, ['first line', 'second line']) 598 call setline(1, ['first line', 'second line'])
599 normal gg 599 normal gg
600 lua << EOF 600 lua << trim EOF
601 w = vim.window() 601 w = vim.window()
602 w.line = 1 602 w.line = 1
603 w.col = 5 603 w.col = 5
604 EOF 604 EOF
605 call assert_equal([1, 5], [line('.'), col('.')]) 605 call assert_equal([1, 5], [line('.'), col('.')])
606 606
607 " Check that movement after setting cursor position keeps current column. 607 " Check that movement after setting cursor position keeps current column.
608 normal j 608 normal j
609 call assert_equal([2, 5], [line('.'), col('.')]) 609 call assert_equal([2, 5], [line('.'), col('.')])
610 endfunc 610 endfunc
611
612 " Test for various heredoc syntax
613 func Test_lua_heredoc()
614 lua << END
615 vim.command('let s = "A"')
616 END
617 lua <<
618 vim.command('let s ..= "B"')
619 .
620 lua << trim END
621 vim.command('let s ..= "C"')
622 END
623 lua << trim
624 vim.command('let s ..= "D"')
625 .
626 call assert_equal('ABCD', s)
627 endfunc
628
629 " vim: shiftwidth=2 sts=2 expandtab