This commit is contained in:
Adam Stankiewicz 2014-01-09 11:59:09 +01:00
parent e45b23b6ee
commit f211f02d1e
13 changed files with 201 additions and 111 deletions

View File

@ -117,7 +117,7 @@ fun! s:DetectScala()
endfun
au BufRead,BufNewFile *.scala,*.sbt set filetype=scala
au BufRead,BufNewFile * call s:DetectScala()
autocmd BufNewFile,BufRead *.slim setf slim
autocmd BufNewFile,BufRead *.slim set filetype=slim
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
au BufRead,BufNewFile *.textile set filetype=textile

View File

@ -365,7 +365,7 @@ function! s:ExtractLabels()
let curname = strpart( getline( lblline ), lblbegin, nameend - lblbegin - 1 )
" Ignore cref entries (because they are duplicates)
if curname =~ "\@cref"
if curname =~ "\@cref\|cref\@"
continue
endif

View File

@ -1,8 +1,3 @@
setlocal textwidth=140
setlocal shiftwidth=2
setlocal softtabstop=2
setlocal expandtab
setlocal formatoptions=tcqr
setlocal commentstring=//%s
let &l:include = '^\s*import'
let &l:includeexpr = 'substitute(v:fname,"\\.","/","g")'

View File

@ -148,6 +148,10 @@ if exists("*searchpairpos")
return val
endfunction
function! s:StripNamespaceAndMacroChars(word)
return substitute(a:word, "\\v%(.*/|[#'`~@^,]*)(.*)", '\1', '')
endfunction
function! s:ClojureIsMethodSpecialCaseWorker(position)
" Find the next enclosing form.
call search('\S', 'Wb')
@ -167,7 +171,8 @@ if exists("*searchpairpos")
call cursor(nextParen)
call search('\S', 'W')
if g:clojure_special_indent_words =~ '\<' . s:CurrentWord() . '\>'
let w = s:StripNamespaceAndMacroChars(s:CurrentWord())
if g:clojure_special_indent_words =~ '\<' . w . '\>'
return 1
endif
@ -273,7 +278,7 @@ if exists("*searchpairpos")
" metacharacters.
"
" e.g. clojure.core/defn and #'defn should both indent like defn.
let ww = substitute(w, "\\v%(.*/|[#'`~@^,]*)(.*)", '\1', '')
let ww = s:StripNamespaceAndMacroChars(w)
if &lispwords =~ '\V\<' . ww . '\>'
return paren[1] + &shiftwidth - 1

View File

@ -25,10 +25,11 @@ let s:block_skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" . s:s
let s:block_start = 'do\|fn'
let s:block_middle = 'else\|match\|elsif\|catch\|after\|rescue'
let s:block_end = 'end'
let s:arrow = '^.*->$'
let s:pipeline = '^\s*|>.*$'
let s:indent_keywords = '\<\%(' . s:block_start . '\|' . s:block_middle . '\)$'
let s:deindent_keywords = '^\s*\<\%(' . s:block_end . '\|' . s:block_middle . '\)\>'
let s:indent_keywords = '\<\%(' . s:block_start . '\|' . s:block_middle . '\)$' . '\|' . s:arrow
let s:deindent_keywords = '^\s*\<\%(' . s:block_end . '\|' . s:block_middle . '\)\>' . '\|' . s:arrow
function! GetElixirIndent(...)
let lnum = prevnonblank(v:lnum - 1)
@ -40,42 +41,38 @@ function! GetElixirIndent(...)
endif
if synIDattr(synID(v:lnum, 1, 1), "name") !~ s:skip_syntax
let splited_line = split(getline(lnum), '\zs')
let current_line = getline(v:lnum)
let last_line = getline(lnum)
let splited_line = split(last_line, '\zs')
let opened_symbol = 0
let opened_symbol += count(splited_line, '[') - count(splited_line, ']')
let opened_symbol += count(splited_line, '{') - count(splited_line, '}')
let ind += opened_symbol * &sw
if getline(lnum) =~ s:indent_keywords .
\ '\|^\s*\%(.*->\)$'
if last_line =~ s:indent_keywords
let ind += &sw
endif
" if line starts with pipeline
" and last line doesn't start with pipeline
if getline(v:lnum) =~ s:pipeline &&
\ getline(lnum) !~ s:pipeline
let ind += &sw
" and last line is an attribution
" indents pipeline in same level as attribution
if current_line =~ s:pipeline &&
\ last_line =~ '^[^=]\+=.\+$'
let b:old_ind = ind
let ind += round(match(last_line, '=') / &sw) * &sw
endif
" if last line starts with pipeline
" and current line doesn't start with pipeline
if getline(lnum) =~ s:pipeline &&
\ getline(v:lnum) !~ s:pipeline
let ind -= &sw
" returns the indentation before the pipeline
if last_line =~ s:pipeline &&
\ current_line !~ s:pipeline
let ind = b:old_ind
endif
" if last line starts with pipeline
" and current line doesn't start with pipeline
" but last line started a block
if getline(lnum) =~ s:pipeline &&
\ getline(v:lnum) !~ s:pipeline &&
\ getline(lnum) =~ s:block_start
let ind += &sw
endif
if getline(v:lnum) =~ s:deindent_keywords
if current_line =~ s:deindent_keywords
let bslnum = searchpair( '\<\%(' . s:block_start . '\):\@!\>',
\ '\<\%(' . s:block_middle . '\):\@!\>\zs',
\ '\<:\@<!' . s:block_end . '\>\zs',
@ -83,6 +80,11 @@ function! GetElixirIndent(...)
\ s:block_skip )
let ind = indent(bslnum)
endif
" indent case statements '->'
if current_line =~ s:arrow
let ind += &sw
endif
endif
return ind

View File

@ -22,7 +22,7 @@ setlocal nosmartindent
" Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetRubyIndent(v:lnum)
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:,.
setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end
setlocal indentkeys+==private,=protected,=public
@ -55,9 +55,10 @@ let s:skip_expr =
\ "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"
" Regex used for words that, at the start of a line, add a level of indent.
let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' .
\ '\|rescue\):\@!\>' .
let s:ruby_indent_keywords =
\ '^\s*\zs\<\%(module\|class\|if\|for' .
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue' .
\ '\|\%(public\|protected\|private\)\=\s*def\):\@!\>' .
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
@ -70,7 +71,8 @@ let s:ruby_deindent_keywords =
" TODO: the do here should be restricted somewhat (only at end of line)?
let s:end_start_regex =
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .
\ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' .
\ '\|\%(public\|protected\|private\)\=\s*def\):\@!\>' .
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
" Regex that defines the middle-match for the 'end' keyword.
@ -99,10 +101,10 @@ let s:bracket_continuation_regex = '%\@<!\%([({[]\)\s*\%(#.*\)\=$'
let s:splat_regex = '[[,(]\s*\*\s*\%(#.*\)\=$'
" Regex that describes all indent access modifiers
let s:access_modifier_regex = '\C^\s*\%(private\|public\|protected\)\s*\%(#.*\)\=$'
let s:access_modifier_regex = '\C^\s*\%(public\|protected\|private\)\s*\%(#.*\)\=$'
" Regex that describes the indent access modifiers (excludes public)
let s:indent_access_modifier_regex = '\C^\s*\%(private\|protected\)\s*\%(#.*\)\=$'
let s:indent_access_modifier_regex = '\C^\s*\%(protected\|private\)\s*\%(#.*\)\=$'
" Regex that defines blocks.
"
@ -118,6 +120,9 @@ let s:block_regex =
let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex
" Regex that describes a leading operator (only a method call's dot for now)
let s:leading_operator_regex = '^\s*[.]'
" 2. Auxiliary Functions {{{1
" ======================
@ -177,7 +182,11 @@ function s:GetMSL(lnum)
" Otherwise, terminate search as we have found our MSL already.
let line = getline(lnum)
if s:Match(lnum, s:splat_regex)
if s:Match(msl, s:leading_operator_regex)
" If the current line starts with a leading operator, keep its indent
" and keep looking for an MSL.
let msl = lnum
elseif s:Match(lnum, s:splat_regex)
" If the above line looks like the "*" of a splat, use the current one's
" indentation.
"
@ -440,6 +449,11 @@ function GetRubyIndent(...)
return 0
endif
" If the current line starts with a leading operator, add a level of indent.
if s:Match(clnum, s:leading_operator_regex)
return indent(s:GetMSL(clnum)) + &sw
endif
" 3.3. Work on the previous line. {{{2
" -------------------------------
@ -479,6 +493,12 @@ function GetRubyIndent(...)
return indent(s:GetMSL(lnum)) + &sw
endif
" If the previous line started with a leading operator, use its MSL's level
" of indent
if s:Match(lnum, s:leading_operator_regex)
return indent(s:GetMSL(lnum))
endif
" If the previous line ended with the "*" of a splat, add a level of indent
if line =~ s:splat_regex
return indent(lnum) + &sw

View File

@ -65,8 +65,8 @@ syn region elixirInterpolation matchgroup=elixirDelimiter start="#{" end="}" con
syn region elixirDocStringStart matchgroup=elixirDocString start=+"""+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
syn region elixirDocStringStart matchgroup=elixirDocString start=+'''+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
syn region elixirDocString start=+\z("""\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo fold keepend
syn region elixirDocString start=+\z('''\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo fold keepend
syn region elixirDocString start=+\z("""\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation fold keepend
syn region elixirDocString start=+\z('''\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation fold keepend
syn match elixirSymbolInterpolated ':\("\)\@=' contains=elixirString
syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)"

View File

@ -70,7 +70,7 @@ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" keepend nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline

View File

@ -176,10 +176,10 @@ endif
" File Descriptors
syn match perlFiledescRead "<\h\w*>"
syn match perlFiledescStatementComma "(\=\s*\u\w*\s*,"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatementNocomma "(\=\s*\u\w*\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatementComma "(\=\s*\<\u\w*\>\s*,"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatementNocomma "(\=\s*\<\u\w*\>\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatement "\u\w*" contained
syn match perlFiledescStatement "\<\u\w*\>" contained
" Special characters in strings and matches
syn match perlSpecialString "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend

File diff suppressed because one or more lines are too long

View File

@ -78,7 +78,7 @@ syn keyword rustTrait Default
syn keyword rustTrait Hash
syn keyword rustTrait FromStr
syn keyword rustTrait FromIterator Extendable
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator ClonableIterator
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator CloneableIterator
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
syn keyword rustTrait Times

View File

@ -12,12 +12,14 @@ syn sync minlines=200 maxlines=1000
syn keyword scalaKeyword catch do else final finally for forSome if
syn keyword scalaKeyword match return throw try while yield
syn keyword scalaKeyword class trait object extends with nextgroup=scalaInstanceDeclaration skipwhite
syn keyword scalaKeyword type nextgroup=scalaTypeTypeDeclaration skipwhite
syn keyword scalaKeyword case nextgroup=scalaKeyword,scalaCaseFollowing skipwhite
syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skipwhite
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
hi link scalaKeyword Keyword
syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome
hi link scalaAkkaSpecialWord PreProc
syn match scalaSymbol /'[_A-Za-z0-9$]\+/
hi link scalaSymbol Number
@ -28,14 +30,26 @@ hi link scalaChar Character
hi link scalaEscapedChar Function
hi link scalaUnicodeChar Special
syn match scalaOperator "||"
syn match scalaOperator "&&"
hi link scalaOperator Special
syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition
syn match scalaNameDefinition /`[^`]\+`/ contained nextgroup=scalaPostNameDefinition
syn match scalaPostNameDefinition /\_s*:\_s*/ contained nextgroup=scalaTypeDeclaration
hi link scalaNameDefinition Function
syn match scalaInstanceDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained
syn match scalaInstanceDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaInstanceHash
syn match scalaInstanceDeclaration /`[^`]\+`/ contained
syn match scalaInstanceHash /#/ contained nextgroup=scalaInstanceDeclaration
hi link scalaInstanceDeclaration Special
hi link scalaInstanceHash Type
syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/
hi link scalaCapitalWord Special
" Handle type declarations specially
syn region scalaTypeStatement matchgroup=Keyword start=/\<type\_s\+\ze/ end=/$/ contains=scalaTypeTypeDeclaration,scalaSquareBrackets,scalaTypeTypeEquals,scalaTypeStatement
" Ugh... duplication of all the scalaType* stuff to handle special highlighting
" of `type X =` declarations
@ -43,18 +57,18 @@ syn match scalaTypeTypeDeclaration /(/ contained nextgroup=scalaTypeTypeExtensio
syn match scalaTypeTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeTypeDeclaration contains=scalaTypeTypeExtension skipwhite
syn match scalaTypeTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals skipwhite
syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeTypeDeclaration skipwhite
syn match scalaTypeTypePostDeclaration /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension contains=ALLBUT,scalaParamAnnotationValue skipwhite
syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeTypeDeclaration skipwhite
syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite
syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
hi link scalaTypeTypeDeclaration Type
hi link scalaTypeTypeExtension Keyword
hi link scalaTypeTypePostDeclaration Special
hi link scalaTypeTypePostExtension Keyword
syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension,scalaTypeEquals contains=scalaRoundBrackets skipwhite
syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite
syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite
syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension,scalaTypeEquals skipwhite
syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeDeclaration skipwhite
syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite
syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeDeclaration skipwhite
hi link scalaTypeDeclaration Type
hi link scalaTypeExtension Keyword
hi link scalaTypePostExtension Keyword
@ -63,14 +77,14 @@ syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$\s]:\_s*\)\ze[_=(\.A-Za-z0-9$]\+/
syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration
hi link scalaTypeAnnotation Normal
syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]*\>/ contained
syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained
syn match scalaCaseFollowing /`[^`]\+`/ contained
hi link scalaCaseFollowing Special
syn keyword scalaKeywordModifier abstract override final lazy implicit private protected sealed null require super
syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super
hi link scalaKeywordModifier Function
syn keyword scalaSpecial this true false package import
syn keyword scalaSpecial this true false package import ne eq
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
syn match scalaSpecial /`[^`]*`/ " Backtick literals
@ -97,23 +111,23 @@ syn region scalaQuasiQuotes matchgroup=Type start=/\<q"/ skip=/\\"/ end=/"/ cont
syn region scalaQuasiQuotes matchgroup=Type start=/\<[tcp]q"/ skip=/\\"/ end=/"/ contains=scalaInterpolation
hi link scalaQuasiQuotes String
syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<q"""/ end=/"""/ contains=scalaInterpolation
syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<[tcp]q"""/ end=/"""/ contains=scalaInterpolation
syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<q"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation
syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<[tcp]q"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation
hi link scalaTripleQuasiQuotes String
syn region scalaTripleString start=/"""/ end=/"""/ contains=scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleSString matchgroup=Special start=/s"""/ end=/"""/ contains=scalaInterpolation,scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleFString matchgroup=Special start=/f"""/ end=/"""/ contains=scalaInterpolation,scalaFInterpolation,scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleSString matchgroup=Special start=/s"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleFString matchgroup=Special start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaFInterpolation,scalaEscapedChar,scalaUnicodeChar
hi link scalaTripleString String
hi link scalaTripleSString String
hi link scalaTripleFString String
syn match scalaNumber /\<0[dDfFlL]\?\>/
syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/
syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/
syn match scalaNumber "\%(\<\d\+\.\d*\|\.\d\+\)\%([eE][-+]\=\d\+\)\=[fFdD]\="
syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
syn match scalaNumber "\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>"
syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number
syn match scalaNumber /\%(\<\d\+\.\d*\|\.\d\+\)\%([eE][-+]\=\d\+\)\=[fFdD]\=/ " exponential notation 1
syn match scalaNumber /\<\d\+[eE][-+]\=\d\+[fFdD]\=\>/ " exponential notation 2
syn match scalaNumber /\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>/ " exponential notation 3
hi link scalaNumber Number
syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets
@ -142,3 +156,17 @@ hi link scalaAnnotation PreProc
syn match scalaTrailingComment "//.*$"
hi link scalaTrailingComment Comment
syn match scalaAkkaFSM /goto([^)]*)\_s\+\<using\>/ contains=scalaAkkaFSMGotoUsing
syn match scalaAkkaFSM /stay\_s\+using/
syn match scalaAkkaFSM /^\s*stay\s*$/
syn match scalaAkkaFSM /when\ze([^)]*)/
syn match scalaAkkaFSM /startWith\ze([^)]*)/
syn match scalaAkkaFSM /initialize\ze()/
syn match scalaAkkaFSM /onTransition/
syn match scalaAkkaFSM /onTermination/
syn match scalaAkkaFSM /whenUnhandled/
syn match scalaAkkaFSMGotoUsing /\<using\>/
syn match scalaAkkaFSMGotoUsing /\<goto\>/
hi link scalaAkkaFSM PreProc
hi link scalaAkkaFSMGotoUsing PreProc

View File

@ -61,6 +61,7 @@ syn region slimInnerAttrString start=+\s*"+ skip=+\%(\\\\\)*\\"+ end=+"\s*+ cont
syn region slimInnerAttrString start=+\s*'+ skip=+\%(\\\\\)*\\"+ end=+'\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr
syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{" end="}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD,slimWrappedAttrs
syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{{" end="}}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD,slimWrappedAttrs
syn match slimInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
syn region slimRuby matchgroup=slimRubyOutputChar start="\s*[=]\==[']\=" skip=",\s*$" end="$" contained contains=@slimRubyTop keepend