Skip to content

Commit c382cd0

Browse files
author
Christopher MCAdams
committed
Length and Function highlighting
1 parent 32fe889 commit c382cd0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

syntax/coffee.vim

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@ syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat
3939
\ display
4040
hi def link coffeeKeyword Keyword
4141

42-
syn match coffeeOperator /\<\%(instanceof\|typeof\|delete\)\>/ display
42+
syn keyword coffeeOperator instanceof typeof delete
4343
hi def link coffeeOperator Operator
4444

45+
syn match coffeeLength /\%(.*\)\.length/hs=e-5
46+
hi def link coffeeLength Label
47+
48+
syn match coffeeFunction /\s\?[-=]>/
49+
hi def link coffeeFunction Function
50+
4551
" The first case matches symbol operators only if they have an operand before.
46-
syn match coffeeExtendedOp /\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?.]\{-1,}\|[-=]>\|--\|++\|:/
52+
syn match coffeeExtendedOp /\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?.]\{-1,}\|--\|++\|:/
4753
\ display
4854
syn match coffeeExtendedOp /\<\%(and\|or\)=/ display
4955
hi def link coffeeExtendedOp coffeeOperator
@@ -214,7 +220,7 @@ syn cluster coffeeAll contains=coffeeStatement,coffeeRepeat,coffeeConditional,
214220
\ coffeeHeredoc,coffeeSpaceError,
215221
\ coffeeSemicolonError,coffeeDotAccess,
216222
\ coffeeProtoAccess,coffeeCurlies,coffeeBrackets,
217-
\ coffeeParens
223+
\ coffeeParens,coffeeFunction,coffeeLength
218224

219225
if !exists('b:current_syntax')
220226
let b:current_syntax = 'coffee'

0 commit comments

Comments
 (0)