aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-10 19:14:29 +0800
committerGitHub <noreply@github.com>2022-04-10 19:14:29 +0800
commitb531e4ea337e4ed86913d59777c5b6b15059a719 (patch)
tree25a3fefe4d50f84fd93476bc2b7fd876ad816c03 /src/nvim/testdir
parentff726cc569994aab61a42c40270e679dc80cca7c (diff)
parent381f8f86da4bf5b24fb993eac281dffd2a2bcd1e (diff)
downloadrneovim-b531e4ea337e4ed86913d59777c5b6b15059a719.tar.gz
rneovim-b531e4ea337e4ed86913d59777c5b6b15059a719.tar.bz2
rneovim-b531e4ea337e4ed86913d59777c5b6b15059a719.zip
Merge pull request #18062 from zeertzjq/vim-8.2.4723
vim-patch:8.2.{4723,4728}: the ModeChanged autocmd event is inefficient
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index c1a120efa4..e3362cd28f 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -2661,5 +2661,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