comparison src/testdir/test_autocmd.vim @ 29873:adc2dec6d27d v9.0.0275

patch 9.0.0275: BufEnter not triggered when using ":edit" in "nofile" buffer Commit: https://github.com/vim/vim/commit/a9b5b85068b2fcb1c01ea20524e227bcad579ceb Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 26 13:16:20 2022 +0100 patch 9.0.0275: BufEnter not triggered when using ":edit" in "nofile" buffer Problem: BufEnter not triggered when using ":edit" in "nofile" buffer. Solution: Let readfile() return NOTDONE. (closes https://github.com/vim/vim/issues/10986)
author Bram Moolenaar <Bram@vim.org>
date Fri, 26 Aug 2022 14:30:03 +0200
parents 6eaef7375f17
children cb4d95b545f1
comparison
equal deleted inserted replaced
29872:01211e2b3df2 29873:adc2dec6d27d
679 call assert_equal('+++', g:val) 679 call assert_equal('+++', g:val)
680 680
681 " On MS-Windows we can't edit the directory, make sure we wipe the right 681 " On MS-Windows we can't edit the directory, make sure we wipe the right
682 " buffer. 682 " buffer.
683 bwipe! Xdir 683 bwipe! Xdir
684
685 call delete('Xdir', 'd') 684 call delete('Xdir', 'd')
685 au! BufEnter
686
687 " Editing a "nofile" buffer doesn't read the file but does trigger BufEnter
688 " for historic reasons.
689 new somefile
690 set buftype=nofile
691 au BufEnter somefile call setline(1, 'some text')
692 edit
693 call assert_equal('some text', getline(1))
694
695 bwipe!
686 au! BufEnter 696 au! BufEnter
687 endfunc 697 endfunc
688 698
689 " Closing a window might cause an endless loop 699 " Closing a window might cause an endless loop
690 " E814 for older Vims 700 " E814 for older Vims