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 endfunc
func dist#ft#FTsys() func dist#ft#FTsys()
if IsRapid() if exists("g:filetype_sys")
exe "setf " .. g:filetype_sys
elseif IsRapid()
setf rapid setf rapid
else else
setf bat 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| *.pp g:filetype_pp |ft-pascal-syntax|
*.prg g:filetype_prg *.prg g:filetype_prg
*.src g:filetype_src *.src g:filetype_src
*.sys g:filetype_sys
*.sh g:bash_is_sh |ft-sh-syntax| *.sh g:bash_is_sh |ft-sh-syntax|
*.tex g:tex_flavor |ft-tex-plugin| *.tex g:tex_flavor |ft-tex-plugin|
*.w g:filetype_w |ft-cweb-syntax| *.w g:filetype_w |ft-cweb-syntax|

View File

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