diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-30 18:17:15 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-30 18:17:15 +0100 |
commit | 9c8f94636b3610b898ffbbd07f6b75866d16cbca (patch) | |
tree | a169b57ddfe9c6605272da81183f1041437e0140 /src/testdir | |
parent | 3e518a8ec74065aedd67d352c93d6ae6be550316 (diff) |
patch 9.0.0332: overwrite check may block BufWriteCmdv9.0.0332
Problem: Overwrite check may block BufWriteCmd.
Solution: Do not use overwrite check when 'buftype' is "acwrite".
(closes #11011)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_autocmd.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index e4b76dba57..b3b4ec5a6f 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -1922,6 +1922,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 ]' |