Skip to content

Commit

Permalink
Add folding to comments and blocks.
Browse files Browse the repository at this point in the history
Used Sohgo Takeuchi's patch file.
  • Loading branch information
JesseKPhillips committed Mar 12, 2011
1 parent 9fa2bbc commit bc5fd07
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions d.vim
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ if exists("d_comment_strings")
syn region dBlockCommentString contained start=+"+ end=+"+ end=+\*/+me=s-1,he=s-1 contains=dCommentStar,dUnicode,dEscSequence,@Spell
syn region dNestedCommentString contained start=+"+ end=+"+ end="+"me=s-1,he=s-1 contains=dCommentPlus,dUnicode,dEscSequence,@Spell
syn region dLineCommentString contained start=+"+ end=+$\|"+ contains=dUnicode,dEscSequence,@Spell
syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell
syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell
syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell fold
syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell fold
syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@Spell
else
syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell
syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell
syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell fold
syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell fold
syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@Spell
endif

Expand Down Expand Up @@ -282,6 +282,10 @@ syn case match
" TODO: Highlight following Integer and optional Filespec.
syn region dPragma start="#\s*\(line\>\)" skip="\\$" end="$"

" Block
"
syn region dBlock start="{" end="}" transparent fold


" The default highlighting.
"
Expand Down

0 comments on commit bc5fd07

Please sign in to comment.