Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax based folding for block comments #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions syntax/racket.vim
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,21 @@ syn region racketQuoted matchgroup=Delimiter start="#['`]("rs=s+3 matchgroup=Del

" Comments
syn match racketComment /;.*$/ contains=racketTodo,racketNote,@Spell
syn region racketMultilineComment start=/#|/ end=/|#/ contains=racketMultilineComment,racketTodo,racketNote,@Spell

if exists("racket_no_comment_fold")
syn region racketBlockComment start=/#|/ end=/|#/ contains=racketBlockComment,racketTodo,racketNote,@Spell
else
syn region racketBlockComment start=/#|/ end=/|#/ contains=racketBlockComment,racketTodo,racketNote,@Spell fold
syn region racketMultilineComment start="^\s*;" end="^\%(\s*;\)\@!" contains=racketComment transparent keepend fold
endif

syn keyword racketTodo FIXME TODO XXX contained
syntax match racketNote /\CNOTE\ze:\?/ contained

syn cluster racketNormal add=racketQuoted,racketComment,racketMultilineComment
syn cluster racketQuotedOrNormal add=racketComment,racketMultilineComment
syn cluster racketComments contains=racketComment,racketBlockComment,racketMultilineComment

syn cluster racketNormal add=racketQuoted,@racketComments
syn cluster racketQuotedOrNormal add=@racketComments


" Synchronization and the wrapping up...
Expand Down Expand Up @@ -648,7 +656,7 @@ if version >= 508 || !exists("did_racket_syntax_inits")
HiLink racketConstant Constant

HiLink racketComment Comment
HiLink racketMultilineComment Comment
HiLink racketBlockComment Comment
HiLink racketTodo Todo
HiLink racketNote SpecialComment
HiLink racketError Error
Expand Down