0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.0150: cannot define python function when using :execute

Problem:    Cannot define python function when using :execute. (Yasuhiro
            Matsumoto)
Solution:   Do not recognize "def" inside "function.
This commit is contained in:
Bram Moolenaar
2020-01-26 16:50:05 +01:00
parent 8a7d6542b3
commit 673660ab00
3 changed files with 19 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
" Test various aspects of the Vim9 script language.
source check.vim
" Check that "lines" inside ":def" results in an "error" message.
func CheckDefFailure(lines, error)
call writefile(['def! Func()'] + a:lines + ['enddef'], 'Xdef')
@@ -355,5 +357,16 @@ def Test_fixed_size_list()
call assert_equal([2, 99, 3, 4, 5], l)
enddef
" Test that inside :function a Python function can be defined, :def is not
" recognized.
func Test_function_python()
CheckFeature python3
let py = 'python3'
execute py "<< EOF"
def do_something():
return 1
EOF
endfunc
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker