diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-19 12:38:34 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-19 12:38:34 +0100 |
commit | a3a9c8ef697bbf6f640cde99710b6f534f29f77d (patch) | |
tree | 358717fb6832b9e8a8bb5f9710e63e994741ba21 /src/testdir/test_options.vim | |
parent | 30d53e2c11e670845830bdfc29bf8c1615df61a8 (diff) | |
download | vim-git-a3a9c8ef697bbf6f640cde99710b6f534f29f77d.tar.gz |
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite checkv8.2.0403
Problem: When 'buftype' is "nofile" there is no overwrite check.
Solution: Also check for existing file when 'buftype' is set.
(closes #5807)
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r-- | src/testdir/test_options.vim | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 3fc016122..fbc6dc193 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -656,7 +656,15 @@ func Test_buftype() call setline(1, ['L1']) set buftype=nowrite call assert_fails('write', 'E382:') - close! + + for val in ['', 'nofile', 'nowrite', 'acwrite', 'quickfix', 'help', 'terminal', 'prompt', 'popup'] + exe 'set buftype=' .. val + call writefile(['something'], 'XBuftype') + call assert_fails('write XBuftype', 'E13:', 'with buftype=' .. val) + endfor + + call delete('XBuftype') + bwipe! endfunc " Test for the 'shellquote' option |