summaryrefslogtreecommitdiffstats
path: root/syntax/scala.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2014-06-08 19:35:34 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2014-06-08 19:35:34 +0200
commit33dd4b2741ce51f02dea47298c6abfc847215889 (patch)
treec56bbb9039ac9beaa7a5c16859dcd7816af5b7c8 /syntax/scala.vim
parentd6866fccedc65c4506c50776e23ec202757382bb (diff)
downloadvim-polyglot-33dd4b2741ce51f02dea47298c6abfc847215889.tar.gz
vim-polyglot-33dd4b2741ce51f02dea47298c6abfc847215889.zip
Update scala
Diffstat (limited to 'syntax/scala.vim')
-rw-r--r--syntax/scala.vim17
1 files changed, 14 insertions, 3 deletions
diff --git a/syntax/scala.vim b/syntax/scala.vim
index a61a60af..b9df50f3 100644
--- a/syntax/scala.vim
+++ b/syntax/scala.vim
@@ -4,8 +4,19 @@ elseif exists("b:current_syntax")
finish
endif
+scriptencoding utf-8
+
let b:current_syntax = "scala"
+function! s:ContainedGroup()
+ try
+ silent syn list @scala
+ return '@scala'
+ catch /E392/
+ return 'TOP'
+ endtry
+endfunction
+
syn case match
syn sync minlines=200 maxlines=1000
@@ -17,7 +28,7 @@ syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skip
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
hi link scalaKeyword Keyword
-syn region scalaBlock start=/{/ end=/}/ contains=TOP fold
+exe 'syn region scalaBlock start=/{/ end=/}/ contains=' . s:ContainedGroup() . ' fold'
syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome
hi link scalaAkkaSpecialWord PreProc
@@ -103,13 +114,13 @@ hi link scalaIString String
hi link scalaTripleIString String
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
-syn region scalaInterpolationB matchgroup=scalaInterpolation start=/\${/ end=/}/ contained contains=TOP
+exe 'syn region scalaInterpolationB matchgroup=scalaInterpolation start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
hi link scalaInterpolation Function
hi link scalaInterpolationB Normal
syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
-syn region scalaFInterpolationB matchgroup=scalaFInterpolation start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=TOP
+exe 'syn region scalaFInterpolationB matchgroup=scalaFInterpolation start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
hi link scalaFString String
hi link scalaFInterpolation Function
hi link scalaFInterpolationB Normal