vim-patch:8.2.4747: no filetype override for .sys files (#18105)

Problem:    No filetype override for .sys files.
Solution:   Add g:filetype_sys. (Patrick Meiser-Knosowski, closes vim/vim#10181)
f420ff2440
This commit is contained in:
Christian Clason 2022-04-13 23:11:56 +02:00 committed by GitHub
parent a9cd9de01d
commit 8486c87e58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -823,7 +823,9 @@ func dist#ft#FTperl()
endfunc
func dist#ft#FTsys()
if IsRapid()
if exists("g:filetype_sys")
exe "setf " .. g:filetype_sys
elseif IsRapid()
setf rapid
else
setf bat

View File

@ -153,6 +153,7 @@ variables can be used to overrule the filetype used for certain extensions:
*.pp g:filetype_pp |ft-pascal-syntax|
*.prg g:filetype_prg
*.src g:filetype_src
*.sys g:filetype_sys
*.sh g:bash_is_sh |ft-sh-syntax|
*.tex g:tex_flavor |ft-tex-plugin|
*.w g:filetype_w |ft-cweb-syntax|

View File

@ -1474,7 +1474,7 @@ endfunc
func Test_sc_file()
filetype on
" SC file mehtods are defined 'Class : Method'
" SC file methods are defined 'Class : Method'
call writefile(['SCNvimDocRenderer : SCDocHTMLRenderer {'], 'srcfile.sc')
split srcfile.sc
call assert_equal('supercollider', &filetype)
@ -1561,6 +1561,13 @@ func Test_sys_file()
call assert_equal('bat', &filetype)
bwipe!
" Users preference set by g:filetype_sys
let g:filetype_sys = 'sys'
split sysfile.sys
call assert_equal('sys', &filetype)
unlet g:filetype_sys
bwipe!
" RAPID header start with a line containing only "%%%",
" but is not always present.
call writefile(['%%%'], 'sysfile.sys')