summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKnoP-01 <knosowski@graeffrobotics.de>2022-04-13 20:46:21 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-13 20:46:21 +0100
commitf420ff2440a009acd9573fdb6ad6d53509d78009 (patch)
tree6335160a2c2f91262322228cbbf90d8a6b087f18
parent8cac20ed42b7b7fc9c6b54e3055ca1047f50b8ca (diff)
downloadvim-git-f420ff2440a009acd9573fdb6ad6d53509d78009.tar.gz
patch 8.2.4747: no filetype override for .sys filesv8.2.4747
Problem: No filetype override for .sys files. Solution: Add g:filetype_sys. (Patrick Meiser-Knosowski, closes #10181)
-rw-r--r--runtime/autoload/dist/ft.vim4
-rw-r--r--runtime/doc/filetype.txt1
-rw-r--r--src/testdir/test_filetype.vim9
-rw-r--r--src/version.c2
4 files changed, 14 insertions, 2 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index ff554dfe8..4c2d20ae7 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -819,7 +819,9 @@ export def FTperl(): number
enddef
export def FTsys()
- if IsRapid()
+ if exists("g:filetype_sys")
+ exe "setf " .. g:filetype_sys
+ elseif IsRapid()
setf rapid
else
setf bat
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index b921c3db0..f538329df 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -155,6 +155,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|
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 34868d601..a94002e08 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -1501,7 +1501,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)
@@ -1588,6 +1588,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')
diff --git a/src/version.c b/src/version.c
index e3ba0c89f..9f9917726 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4747,
+/**/
4746,
/**/
4745,