Add highlighting of ternary operator in C/C++

This commit is contained in:
Kenneth Benzie 2016-10-19 19:58:50 +01:00
parent 20ca44e2ff
commit 4a9d8df177

View File

@ -14,7 +14,9 @@ syn match cOperator '\(\s\zs\/\s\ze\|\s\zs<\s\ze\|\s\zs>\s\ze\)'
" Match multi character operators
syn match cOperator '\(+=\|-=\|\*=\|/=\|%=\|\ˆ=\|&=\||=\|<<\|>>\|>>=\)'
syn match cOperator '\(<<=\|==\|!=\|<=\|>=\|&&\|||\|++\|--\|->\*\|->\)'
" TODO: Match : in ternary operator as cOperator
" Match : in ternary operator as cOperator
syn region cOperatorTernary matchgroup=cOperator start='?' end=':' transparent
" TODO: Match operator/ operator< operator>
" Match function expressions: expr()
" ^^^^
syn match cFunction '\w[A-Za-z0-9_]*\ze\s*('
@ -34,10 +36,10 @@ if exists('g:c_doxygen') && g:c_doxygen
hi default link cDoxygenTodo Todo
endif
" Match curly braces with cDelimiter highlight group
syn region cBlock matchgroup=cDelimiter start="{" end="}" transparent fold
" Define additional highlight groups
hi default link cDelimiter Delimiter
hi default link cFunction Function