comparison src/testdir/test_autocmd.vim @ 23758:97296182d336 v8.2.2420

patch 8.2.2420: too many problems with using all autocommand events Commit: https://github.com/vim/vim/commit/9a046fd08bcae319d39a4dbde2be81decee19013 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 28 13:47:59 2021 +0100 patch 8.2.2420: too many problems with using all autocommand events Problem: Too many problems with using all autocommand events. Solution: Disallow defining an autocommand for all events.
author Bram Moolenaar <Bram@vim.org>
date Thu, 28 Jan 2021 14:00:04 +0100
parents 65d11d6ed4c2
children bb2afcad503b
comparison
equal deleted inserted replaced
23757:b873d83d2f87 23758:97296182d336
1825 au! TextYankPost 1825 au! TextYankPost
1826 unlet g:event 1826 unlet g:event
1827 bwipe! 1827 bwipe!
1828 endfunc 1828 endfunc
1829 1829
1830 func Test_nocatch_wipe_all_buffers() 1830 func Test_autocommand_all_events()
1831 " Real nasty autocommand: wipe all buffers on any event. 1831 call assert_fails('au * * bwipe', 'E1155:')
1832 au * * bwipe * 1832 call assert_fails('au * x bwipe', 'E1155:')
1833 call assert_fails('next x', ['E94:', 'E937:'])
1834 bwipe
1835 au!
1836 endfunc
1837
1838 func Test_nocatch_wipe_dummy_buffer()
1839 CheckFeature quickfix
1840 " Nasty autocommand: wipe buffer on any event.
1841 au * x bwipe
1842 call assert_fails('lvĀ½ /x', 'E937:')
1843 au!
1844 endfunc 1833 endfunc
1845 1834
1846 function s:Before_test_dirchanged() 1835 function s:Before_test_dirchanged()
1847 augroup test_dirchanged 1836 augroup test_dirchanged
1848 autocmd! 1837 autocmd!