aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-04-13 17:04:38 +0200
committerGitHub <noreply@github.com>2022-04-13 17:04:38 +0200
commit9938740ca6eae26de7c6deff8dd8318136ee5113 (patch)
tree80120713cc58d5d9a5bbed8e4e6135c1c8bb73fd /runtime/autoload
parent7d1142b7e7dcb906e69752783ef1c6f366f5c0ae (diff)
downloadrneovim-9938740ca6eae26de7c6deff8dd8318136ee5113.tar.gz
rneovim-9938740ca6eae26de7c6deff8dd8318136ee5113.tar.bz2
rneovim-9938740ca6eae26de7c6deff8dd8318136ee5113.zip
vim-patch:8.2.4746: supercollider filetype not recognized (#18102)
Problem: Supercollider filetype not recognized. Solution: Match file extentions and check file contents to detect supercollider. (closes vim/vim#10142) https://github.com/vim/vim/commit/8cac20ed42b7b7fc9c6b54e3055ca1047f50b8ca
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/dist/ft.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 0063e9da0b..866196a7df 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -773,6 +773,28 @@ func dist#ft#SQL()
endif
endfunc
+" This function checks the first 25 lines of file extension "sc" to resolve
+" detection between scala and SuperCollider
+func dist#ft#FTsc()
+ for lnum in range(1, min([line("$"), 25]))
+ if getline(lnum) =~# '[A-Za-z0-9]*\s:\s[A-Za-z0-9]\|var\s<\|classvar\s<\|\^this.*\||\w*|\|+\s\w*\s{\|\*ar\s'
+ setf supercollider
+ return
+ endif
+ endfor
+ setf scala
+endfunc
+
+" This function checks the first line of file extension "scd" to resolve
+" detection between scdoc and SuperCollider
+func dist#ft#FTscd()
+ if getline(1) =~# '\%^\S\+(\d[0-9A-Za-z]*)\%(\s\+\"[^"]*\"\%(\s\+\"[^"]*\"\)\=\)\=$'
+ setf scdoc
+ else
+ setf supercollider
+ endif
+endfunc
+
" If the file has an extension of 't' and is in a directory 't' or 'xt' then
" it is almost certainly a Perl test file.
" If the first line starts with '#' and contains 'perl' it's probably a Perl