Mercurial > vim
comparison src/testdir/test_filetype.vim @ 11459:561b76ed9d12 v8.0.0613
patch 8.0.0613: the conf filetype is used before ftdetect from packages
commit https://github.com/vim/vim/commit/3e54569b17683318e0cb6693ab0024c2ad1e3e8f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 4 19:00:32 2017 +0200
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Problem: The conf filetype detection is done before ftdetect scripts from
packages that are added later.
Solution: Add the FALLBACK argument to :setfiletype. (closes #1679,
closes #1693)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 04 Jun 2017 19:15:03 +0200 |
parents | |
children | c2aa4af29251 |
comparison
equal
deleted
inserted
replaced
11458:8322abc9fced | 11459:561b76ed9d12 |
---|---|
1 " Test :setfiletype | |
2 | |
3 func Test_detection() | |
4 filetype on | |
5 augroup filetypedetect | |
6 au BufNewFile,BufRead * call assert_equal(1, did_filetype()) | |
7 augroup END | |
8 new something.vim | |
9 call assert_equal('vim', &filetype) | |
10 | |
11 bwipe! | |
12 filetype off | |
13 endfunc | |
14 | |
15 func Test_conf_type() | |
16 filetype on | |
17 call writefile(['# some comment', 'must be conf'], 'Xfile') | |
18 augroup filetypedetect | |
19 au BufNewFile,BufRead * call assert_equal(0, did_filetype()) | |
20 augroup END | |
21 split Xfile | |
22 call assert_equal('conf', &filetype) | |
23 | |
24 bwipe! | |
25 call delete('Xfile') | |
26 filetype off | |
27 endfunc | |
28 | |
29 func Test_other_type() | |
30 filetype on | |
31 augroup filetypedetect | |
32 au BufNewFile,BufRead * call assert_equal(0, did_filetype()) | |
33 au BufNewFile,BufRead Xfile setf testfile | |
34 au BufNewFile,BufRead * call assert_equal(1, did_filetype()) | |
35 augroup END | |
36 call writefile(['# some comment', 'must be conf'], 'Xfile') | |
37 split Xfile | |
38 call assert_equal('testfile', &filetype) | |
39 | |
40 bwipe! | |
41 call delete('Xfile') | |
42 filetype off | |
43 endfunc |