Add highlighting of ternary operator in C/C++
This commit is contained in:
parent
20ca44e2ff
commit
4a9d8df177
@ -14,7 +14,9 @@ syn match cOperator '\(\s\zs\/\s\ze\|\s\zs<\s\ze\|\s\zs>\s\ze\)'
|
|||||||
" Match multi character operators
|
" Match multi character operators
|
||||||
syn match cOperator '\(+=\|-=\|\*=\|/=\|%=\|\ˆ=\|&=\||=\|<<\|>>\|>>=\)'
|
syn match cOperator '\(+=\|-=\|\*=\|/=\|%=\|\ˆ=\|&=\||=\|<<\|>>\|>>=\)'
|
||||||
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()
|
" Match function expressions: expr()
|
||||||
" ^^^^
|
" ^^^^
|
||||||
syn match cFunction '\w[A-Za-z0-9_]*\ze\s*('
|
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
|
hi default link cDoxygenTodo Todo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" Match curly braces with cDelimiter highlight group
|
" Match curly braces with cDelimiter highlight group
|
||||||
syn region cBlock matchgroup=cDelimiter start="{" end="}" transparent fold
|
syn region cBlock matchgroup=cDelimiter start="{" end="}" transparent fold
|
||||||
|
|
||||||
|
|
||||||
" Define additional highlight groups
|
" Define additional highlight groups
|
||||||
hi default link cDelimiter Delimiter
|
hi default link cDelimiter Delimiter
|
||||||
hi default link cFunction Function
|
hi default link cFunction Function
|
||||||
|
Loading…
x
Reference in New Issue
Block a user