neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 381f8f86da4bf5b24fb993eac281dffd2a2bcd1e
parent 263a7fde35f2341f526a536690122b927300021a
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Sun, 10 Apr 2022 18:45:11 +0800

vim-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 vim/vim#10139)
https://github.com/vim/vim/commit/021996ffaa933d9dc0c3553ca01de93fbf3d522b

Diffstat:
Msrc/nvim/testdir/test_autocmd.vim | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git 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