0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1539: using invalid script ID causes a crash

Problem:    Using invalid script ID causes a crash.
Solution:   Check the script ID to be valid. (closes #6804)
This commit is contained in:
Bram Moolenaar
2020-08-29 13:39:17 +02:00
parent 423a85a11a
commit e3d4685f1f
7 changed files with 43 additions and 21 deletions

View File

@@ -4,6 +4,7 @@ source check.vim
source term_util.vim
source view_util.vim
source vim9.vim
source shared.vim
def Test_syntax()
let var = 234
@@ -3252,6 +3253,14 @@ def Test_cmdline_win()
delete('rtp', 'rf')
enddef
def Test_invalid_sid()
assert_fails('func <SNR>1234_func', 'E123:')
if RunVim([], ['wq Xdidit'], '+"func <SNR>1_func"')
call assert_equal([], readfile('Xdidit'))
endif
delete('Xdidit')
enddef
" Keep this last, it messes up highlighting.
def Test_substitute_cmd()
new