Patch 8.2.4728

6 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 10, 2022, 6:44:45 AM4/10/22
to vim...@googlegroups.com

Patch 8.2.4728
Problem: No test that v:event cannot be modified.
Solution: Add a test. (closes #10139)
Files: src/testdir/test_autocmd.vim


*** ../vim-8.2.4727/src/testdir/test_autocmd.vim 2022-04-09 11:37:08.196325535 +0100
--- src/testdir/test_autocmd.vim 2022-04-10 11:42:18.117406003 +0100
***************
*** 3117,3121 ****
--- 3117,3139 ----
%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
*** ../vim-8.2.4727/src/version.c 2022-04-10 11:26:00.945539611 +0100
--- src/version.c 2022-04-10 11:43:53.009337034 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4728,
/**/

--
LARGE MAN: Who's that then?
CART DRIVER: (Grudgingly) I dunno, Must be a king.
LARGE MAN: Why?
CART DRIVER: He hasn't got shit all over him.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages