mirror of
https://github.com/neovim/neovim.git
synced 2025-10-12 21:06:13 +00:00
vim-patch:9.0.0349: filetype of *.sil files not well detected (#20050)
Problem: Filetype of *.sil files not well detected.
Solution: Inspect the file contents to guess the filetype.
be807d5824
This commit is contained in:

committed by
GitHub

parent
12fe197cff
commit
ce80b8f50d
@@ -1824,6 +1824,44 @@ func Test_sig_file()
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
" Test dist#ft#FTsil()
|
||||
func Test_sil_file()
|
||||
filetype on
|
||||
|
||||
split Xfile.sil
|
||||
call assert_equal('sil', &filetype)
|
||||
bwipe!
|
||||
|
||||
let lines =<< trim END
|
||||
// valid
|
||||
let protoErasedPathA = \ABCProtocol.a
|
||||
|
||||
// also valid
|
||||
let protoErasedPathA =
|
||||
\ABCProtocol.a
|
||||
END
|
||||
call writefile(lines, 'Xfile.sil')
|
||||
|
||||
split Xfile.sil
|
||||
call assert_equal('sil', &filetype)
|
||||
bwipe!
|
||||
|
||||
" SILE
|
||||
|
||||
call writefile(['% some comment'], 'Xfile.sil')
|
||||
split Xfile.sil
|
||||
call assert_equal('sile', &filetype)
|
||||
bwipe!
|
||||
|
||||
call writefile(['\begin[papersize=a6]{document}foo\end{document}'], 'Xfile.sil')
|
||||
split Xfile.sil
|
||||
call assert_equal('sile', &filetype)
|
||||
bwipe!
|
||||
|
||||
call delete('Xfile.sil')
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_inc_file()
|
||||
filetype on
|
||||
|
||||
|
Reference in New Issue
Block a user