summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-10 11:44:04 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-10 11:44:04 +0100
commit021996ffaa933d9dc0c3553ca01de93fbf3d522b (patch)
treef388bf74687e416ecac4c000d9f2248f19cf397a
parent7765f5cf964c751cd780484220bb65773b1b0348 (diff)
downloadvim-git-021996ffaa933d9dc0c3553ca01de93fbf3d522b.tar.gz
patch 8.2.4728: no test that v:event cannot be modifiedv8.2.4728
Problem: No test that v:event cannot be modified. Solution: Add a test. (closes #10139)
-rw-r--r--src/testdir/test_autocmd.vim18
-rw-r--r--src/version.c2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 896c563f7..9af79d8e1 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index ff5f399de..9657184d2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4728,
+/**/
4727,
/**/
4726,