diff options
author | Jonas Strittmatter <40792180+smjonas@users.noreply.github.com> | 2022-09-02 08:16:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-02 08:16:17 +0200 |
commit | ce80b8f50d7d56ac12aa06a64a65799ec18b69af (patch) | |
tree | 778a1643173565b4b12175eb863c67072e76a02f /src | |
parent | 12fe197cffc687cedc65259d9fd8351a25aa7792 (diff) | |
download | rneovim-ce80b8f50d7d56ac12aa06a64a65799ec18b69af.tar.gz rneovim-ce80b8f50d7d56ac12aa06a64a65799ec18b69af.tar.bz2 rneovim-ce80b8f50d7d56ac12aa06a64a65799ec18b69af.zip |
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.
https://github.com/vim/vim/commit/be807d582499acbe314ead3891481cba6ca136df
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_filetype.vim | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 68ce9148a4..4f5ae830b7 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -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 |