comparison src/testdir/test_vim9_func.vim @ 24826:a8d64f1a223b v8.2.2951

patch 8.2.2951: Vim9: cannot use heredoc for :python, :lua, etc. Commit: https://github.com/vim/vim/commit/2067733b5c76e996238af938af36b8196366b7ce Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 6 17:02:53 2021 +0200 patch 8.2.2951: Vim9: cannot use heredoc for :python, :lua, etc. Problem: Vim9: cannot use heredoc in :def function for :python, :lua, etc. Solution: Concatenate the heredoc lines and pass them in the ISN_EXEC_SPLIT instruction.
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Jun 2021 17:15:03 +0200
parents 7464d4c927f5
children c9ccb1976049
comparison
equal deleted inserted replaced
24825:93958f984c68 24826:a8d64f1a223b
2756 ) 2756 )
2757 END 2757 END
2758 call CheckDefAndScriptSuccess(lines) 2758 call CheckDefAndScriptSuccess(lines)
2759 enddef 2759 enddef
2760 2760
2761 if has('python3')
2762 def Test_python3_heredoc()
2763 py3 << trim EOF
2764 import vim
2765 vim.vars['didit'] = 'yes'
2766 EOF
2767 assert_equal('yes', g:didit)
2768
2769 python3 << trim EOF
2770 import vim
2771 vim.vars['didit'] = 'again'
2772 EOF
2773 assert_equal('again', g:didit)
2774 enddef
2775 endif
2776
2777 " This messes up syntax highlight, keep near the end.
2778 if has('lua')
2779 def Test_lua_heredoc()
2780 g:d = {}
2781 lua << trim EOF
2782 x = vim.eval('g:d')
2783 x['key'] = 'val'
2784 EOF
2785 assert_equal('val', g:d.key)
2786 enddef
2787 endif
2788
2761 2789
2762 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker 2790 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker