mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.2.0731: Vim9: parsing declarations continues after :finish
Problem: Vim9: parsing declarations continues after :finish. Solution: Bail out when encountering :finish.
This commit is contained in:
@@ -1705,6 +1705,23 @@ def Test_vim9_comment_not_compiled()
|
||||
], 'E488:')
|
||||
enddef
|
||||
|
||||
def Test_finish()
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
let g:res = 'one'
|
||||
if v:false | finish | endif
|
||||
let g:res = 'two'
|
||||
finish
|
||||
let g:res = 'three'
|
||||
END
|
||||
writefile(lines, 'Xfinished')
|
||||
source Xfinished
|
||||
assert_equal('two', g:res)
|
||||
|
||||
unlet g:res
|
||||
delete('Xfinished')
|
||||
enddef
|
||||
|
||||
" Keep this last, it messes up highlighting.
|
||||
def Test_substitute_cmd()
|
||||
new
|
||||
|
Reference in New Issue
Block a user