aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-11-10 23:17:20 +0800
committerckelsel <ckelsel@hotmail.com>2017-11-10 23:28:24 +0800
commit7e8212c459b285aacf2dd225c1dad5593314f094 (patch)
treecb7e2b6f9925390e5cb5501432a375ccb6211436 /src/nvim/testdir
parent314ff440f7130c39d7990295535a8cfde92de4ba (diff)
downloadrneovim-7e8212c459b285aacf2dd225c1dad5593314f094.tar.gz
rneovim-7e8212c459b285aacf2dd225c1dad5593314f094.tar.bz2
rneovim-7e8212c459b285aacf2dd225c1dad5593314f094.zip
vim-patch:8.0.0224
Problem: When 'fileformats' is changed in a BufReadPre auto command, it does not take effect in readfile(). (Gary Johnson) Solution: Check the value of 'fileformats' after executing auto commands. (Christian Brabandt) https://github.com/vim/vim/commit/7a2699e868bca781e26b060a44fc714d87cfa4ba
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_fileformat.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_fileformat.vim b/src/nvim/testdir/test_fileformat.vim
index 584f20cdfc..256a7d5b1c 100644
--- a/src/nvim/testdir/test_fileformat.vim
+++ b/src/nvim/testdir/test_fileformat.vim
@@ -15,3 +15,17 @@ func Test_fileformat_after_bw()
call assert_equal(test_fileformats, &fileformat)
set fileformats&
endfunc
+
+func Test_fileformat_autocommand()
+ let filecnt=['', 'foobar', 'eins', '', 'zwei', 'drei', 'vier', 'fünf', '']
+ let ffs=&ffs
+ call writefile(filecnt, 'Xfile', 'b')
+ au BufReadPre Xfile set ffs=dos ff=dos
+ new Xfile
+ call assert_equal('dos', &l:ff)
+ call assert_equal('dos', &ffs)
+ " cleanup
+ let &ffs=ffs
+ au! BufReadPre Xfile
+ bw!
+endfunc