0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.4728: no test that v:event cannot be modified

Problem:    No test that v:event cannot be modified.
Solution:   Add a test. (closes #10139)
This commit is contained in:
zeertzjq 2022-04-10 11:44:04 +01:00 committed by Bram Moolenaar
parent 7765f5cf96
commit 021996ffaa
2 changed files with 20 additions and 0 deletions

View File

@ -3117,5 +3117,23 @@ func Test_bufwipeout_changes_window()
%bwipe!
endfunc
func Test_v_event_readonly()
autocmd CompleteChanged * let v:event.width = 0
call assert_fails("normal! i\<C-X>\<C-V>", 'E46:')
au! CompleteChanged
autocmd DirChangedPre * let v:event.directory = ''
call assert_fails('cd .', 'E46:')
au! DirChangedPre
autocmd ModeChanged * let v:event.new_mode = ''
call assert_fails('normal! cc', 'E46:')
au! ModeChanged
autocmd TextYankPost * let v:event.operator = ''
call assert_fails('normal! yy', 'E46:')
au! TextYankPost
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4728,
/**/
4727,
/**/