Mercurial > vim
comparison src/testdir/test_options.vim @ 19693:9fbeb3bdf49e v8.2.0403
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Commit: https://github.com/vim/vim/commit/a3a9c8ef697bbf6f640cde99710b6f534f29f77d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 19 12:38:34 2020 +0100
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Problem: When 'buftype' is "nofile" there is no overwrite check.
Solution: Also check for existing file when 'buftype' is set.
(closes #5807)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 19 Mar 2020 12:45:04 +0100 |
parents | bab20768e1fd |
children | a653d1a165ef |
comparison
equal
deleted
inserted
replaced
19692:95a9cf2b8a40 | 19693:9fbeb3bdf49e |
---|---|
654 func Test_buftype() | 654 func Test_buftype() |
655 new | 655 new |
656 call setline(1, ['L1']) | 656 call setline(1, ['L1']) |
657 set buftype=nowrite | 657 set buftype=nowrite |
658 call assert_fails('write', 'E382:') | 658 call assert_fails('write', 'E382:') |
659 close! | 659 |
660 for val in ['', 'nofile', 'nowrite', 'acwrite', 'quickfix', 'help', 'terminal', 'prompt', 'popup'] | |
661 exe 'set buftype=' .. val | |
662 call writefile(['something'], 'XBuftype') | |
663 call assert_fails('write XBuftype', 'E13:', 'with buftype=' .. val) | |
664 endfor | |
665 | |
666 call delete('XBuftype') | |
667 bwipe! | |
660 endfunc | 668 endfunc |
661 | 669 |
662 " Test for the 'shellquote' option | 670 " Test for the 'shellquote' option |
663 func Test_shellquote() | 671 func Test_shellquote() |
664 CheckUnix | 672 CheckUnix |