1
0
forked from aniani/vim

patch 8.2.2386: Vim9: crash when using ":silent! put"

Problem:    Vim9: crash when using ":silent! put".
Solution:   When ignoring an error for ":silent!" rewind the stack and skip
            ahead to restoring the cmdmod. (closes #7717)
This commit is contained in:
Bram Moolenaar
2021-01-21 19:41:16 +01:00
parent e71996bd08
commit f904133e1a
3 changed files with 37 additions and 0 deletions

View File

@@ -2184,6 +2184,24 @@ def Test_dict_member_with_silent()
CheckScriptSuccess(lines)
enddef
def Test_skip_cmds_with_silent()
var lines =<< trim END
vim9script
def Func(b: bool)
Crash()
enddef
def Crash()
sil! :/not found/d _
sil! :/not found/put _
enddef
Func(true)
END
CheckScriptSuccess(lines)
enddef
def Test_opfunc()
nnoremap <F3> <cmd>set opfunc=Opfunc<cr>g@
def g:Opfunc(_: any): string