forked from neovim/neovim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vim-patch:8.0.0613: the conf filetype is used before ftdetect from pa…
…ckages Problem: The conf filetype detection is done before ftdetect scripts from packages that are added later. Solution: Add the FALLBACK argument to :setfiletype. (closes vim/vim#1679, closes vim/vim#1693) vim/vim@3e54569
- Loading branch information
Showing
4 changed files
with
80 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
" Test :setfiletype | ||
|
||
func Test_detection() | ||
filetype on | ||
augroup filetypedetect | ||
au BufNewFile,BufRead * call assert_equal(1, did_filetype()) | ||
augroup END | ||
new something.vim | ||
call assert_equal('vim', &filetype) | ||
|
||
bwipe! | ||
filetype off | ||
endfunc | ||
|
||
func Test_conf_type() | ||
filetype on | ||
call writefile(['# some comment', 'must be conf'], 'Xfile') | ||
augroup filetypedetect | ||
au BufNewFile,BufRead * call assert_equal(0, did_filetype()) | ||
augroup END | ||
split Xfile | ||
call assert_equal('conf', &filetype) | ||
|
||
bwipe! | ||
call delete('Xfile') | ||
filetype off | ||
endfunc | ||
|
||
func Test_other_type() | ||
filetype on | ||
augroup filetypedetect | ||
au BufNewFile,BufRead * call assert_equal(0, did_filetype()) | ||
au BufNewFile,BufRead Xfile setf testfile | ||
au BufNewFile,BufRead * call assert_equal(1, did_filetype()) | ||
augroup END | ||
call writefile(['# some comment', 'must be conf'], 'Xfile') | ||
split Xfile | ||
call assert_equal('testfile', &filetype) | ||
|
||
bwipe! | ||
call delete('Xfile') | ||
filetype off | ||
endfunc |