aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-12-14 19:46:17 +0100
committerGitHub <noreply@github.com>2022-12-14 19:46:17 +0100
commit4a78ed60a3acd3a5694cc34debd4d91bed96195a (patch)
tree9bd005109c761560f61ffec53b9f40fea4e67824
parent6631df9107ff0d778ca03731867c477c8591f1fc (diff)
downloadrneovim-4a78ed60a3acd3a5694cc34debd4d91bed96195a.tar.gz
rneovim-4a78ed60a3acd3a5694cc34debd4d91bed96195a.tar.bz2
rneovim-4a78ed60a3acd3a5694cc34debd4d91bed96195a.zip
vim-patch:9.0.1057: conflict between supercollider and scala filetype detection (#21417)
Problem: Conflict between supercollider and scala filetype detection. Solution: Do not check for "Class : Method", it can appear in both filetypes. (Chris Kipp, closes vim/vim#11699) https://github.com/vim/vim/commit/70ef3f546b6ef83e463e91b7e388d9c68ad58894 Co-authored-by: Chris Kipp <ckipp@pm.me>
-rw-r--r--runtime/lua/vim/filetype/detect.lua3
-rw-r--r--src/nvim/testdir/test_filetype.vim7
2 files changed, 1 insertions, 9 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua
index a5f20b61a6..ee538dc8c7 100644
--- a/runtime/lua/vim/filetype/detect.lua
+++ b/runtime/lua/vim/filetype/detect.lua
@@ -1097,11 +1097,10 @@ function M.sc(bufnr)
for _, line in ipairs(getlines(bufnr, 1, 25)) do
if
findany(line, {
- '[A-Za-z0-9]*%s:%s[A-Za-z0-9]',
'var%s<',
'classvar%s<',
'%^this.*',
- '|%w*|',
+ '|%w+|',
'%+%s%w*%s{',
'%*ar%s',
})
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index 88f0c74d37..3edfa1b407 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -1555,13 +1555,6 @@ endfunc
func Test_sc_file()
filetype on
- " SC file methods are defined 'Class : Method'
- call writefile(['SCNvimDocRenderer : SCDocHTMLRenderer {'], 'srcfile.sc')
- split srcfile.sc
- call assert_equal('supercollider', &filetype)
- bwipe!
- call delete('srcfile.sc')
-
" SC classes are defined with '+ Class {}'
call writefile(['+ SCNvim {', '*methodArgs {|method|'], 'srcfile.sc')
split srcfile.sc