summaryrefslogtreecommitdiff
path: root/runtime/syntax/c.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax/c.vim')
-rw-r--r--runtime/syntax/c.vim16
1 files changed, 13 insertions, 3 deletions
diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim
index 759bebb68..ee739b9e0 100644
--- a/runtime/syntax/c.vim
+++ b/runtime/syntax/c.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2004 Feb 04
+" Last Change: 2004 Dec 09
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -124,15 +124,25 @@ if exists("c_comment_strings")
syntax region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip
syntax region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial
syntax region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell
- syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell
+ if exists("c_no_comment_fold")
+ syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell
+ else
+ syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell fold
+ endif
else
syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell
- syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell
+ if exists("c_no_comment_fold")
+ syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell
+ else
+ syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell fold
+ endif
endif
" keep a // comment separately, it terminates a preproc. conditional
syntax match cCommentError display "\*/"
syntax match cCommentStartError display "/\*"me=e-1 contained
+syntax region cBlock start="{" end="}" transparent fold
+
syn keyword cOperator sizeof
if exists("c_gnu")
syn keyword cStatement __asm__