aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-26 19:04:20 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-08-27 06:12:52 +0800
commit900a151bf541c7fa77a56b4881c4836a1cabcde6 (patch)
tree32973768295e652ac35bdc946a7f76d5cefcc0d0 /src/nvim/testdir
parentb0e052a8b30ce84221c3f992e111713451633b36 (diff)
downloadrneovim-900a151bf541c7fa77a56b4881c4836a1cabcde6.tar.gz
rneovim-900a151bf541c7fa77a56b4881c4836a1cabcde6.tar.bz2
rneovim-900a151bf541c7fa77a56b4881c4836a1cabcde6.zip
vim-patch:9.0.0272: BufReadCmd not triggered when loading a "nofile" buffer
Problem: BufReadCmd not triggered when loading a "nofile" buffer. (Maxim Kim) Solution: Call readfile() but bail out before reading a file. (closes vim/vim#10983) https://github.com/vim/vim/commit/b1d2c8116cb5577961ea109651fb888b5e58265f
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 5451dcf241..f21b958f1a 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -493,6 +493,18 @@ func Test_BufReadCmdHelpJump()
au! BufReadCmd
endfunc
+" BufReadCmd is triggered for a "nofile" buffer
+func Test_BufReadCmdNofile()
+ new somefile
+ set buftype=nofile
+ au BufReadCmd somefile call setline(1, 'triggered')
+ edit
+ call assert_equal('triggered', getline(1))
+
+ au! BufReadCmd
+ bwipe!
+endfunc
+
func Test_augroup_deleted()
" This caused a crash before E936 was introduced
augroup x