aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-31 06:27:39 +0800
committerGitHub <noreply@github.com>2022-08-31 06:27:39 +0800
commit94a2bc594020f2bb1f41d5e2e92d05ce9c293254 (patch)
tree155cb4ad637b0a4a82f4e2528f50c60c77bdf330 /src/nvim/testdir
parent813476bf7291dfaf9fc0ef77c9f53a07258a3801 (diff)
downloadrneovim-94a2bc594020f2bb1f41d5e2e92d05ce9c293254.tar.gz
rneovim-94a2bc594020f2bb1f41d5e2e92d05ce9c293254.tar.bz2
rneovim-94a2bc594020f2bb1f41d5e2e92d05ce9c293254.zip
vim-patch:9.0.0332: overwrite check may block BufWriteCmd (#20014)
Problem: Overwrite check may block BufWriteCmd. Solution: Do not use overwrite check when 'buftype' is "acwrite". (closes vim/vim#11011) https://github.com/vim/vim/commit/9c8f94636b3610b898ffbbd07f6b75866d16cbca
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 27bc6303cf..3064b199d9 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -1836,6 +1836,21 @@ func Test_BufReadCmd()
au! BufWriteCmd
endfunc
+func Test_BufWriteCmd()
+ autocmd BufWriteCmd Xbufwritecmd let g:written = 1
+ new
+ file Xbufwritecmd
+ set buftype=acwrite
+ call mkdir('Xbufwritecmd')
+ write
+ " BufWriteCmd should be triggered even if a directory has the same name
+ call assert_equal(1, g:written)
+ call delete('Xbufwritecmd', 'd')
+ unlet g:written
+ au! BufWriteCmd
+ bwipe!
+endfunc
+
func SetChangeMarks(start, end)
exe a:start .. 'mark ['
exe a:end .. 'mark ]'