@@ -66,7 +66,7 @@ com! -nargs=* SynFold call s:run_syntax_fold(<q-args>)
6666
6767" }}}
6868
69- syn cluster rubyNotTop contains =@rubyExtendedStringSpecial,@ rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo, rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyEncoding
69+ syn cluster rubyNotTop contains =@rubyCommentNotTop,@rubyStringNotTop,@ rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyModuleName,rubyClassName,rubySymbolDelimiter
7070
7171" Whitespace Errors {{{1
7272if exists (" ruby_space_errors" )
@@ -111,6 +111,11 @@ syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=ruby
111111syn region rubyNestedAngleBrackets start =" <" skip =" \\\\\|\\ >" matchgroup =rubyString end =" >" transparent contained
112112syn region rubyNestedSquareBrackets start =" \[ " skip =" \\\\\|\\\] " matchgroup =rubyString end =" \] " transparent contained
113113
114+ syn cluster rubySingleCharEscape contains =rubyBackslashEscape,rubyQuoteEscape,rubySpaceEscape,rubyParenthesesEscape,rubyCurlyBracesEscape,rubyAngleBracketsEscape,rubySquareBracketsEscape
115+ syn cluster rubyNestedBrackets contains =rubyNested.\+
116+ syn cluster rubyStringSpecial contains =rubyInterpolation,rubyStringEscape
117+ syn cluster rubyStringNotTop contains =@rubyStringSpecial,@rubyNestedBrackets,@rubySingleCharEscape
118+
114119" Regular Expression Metacharacters {{{1
115120syn region rubyRegexpComment matchgroup =rubyRegexpSpecial start =" (?#" skip =" \\\\\|\\ )" end =" )" contained
116121syn region rubyRegexpParens matchgroup =rubyRegexpSpecial start =" (\( ?:\| ?<\= [=!]\| ?>\| ?<[a-z_]\w *>\| ?[imx]*-[imx]*:\=\|\% (?#\)\@ !\) " skip =" \\\\\|\\ )" end =" )" contained transparent contains =@rubyRegexpSpecial
@@ -132,9 +137,7 @@ syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" con
132137syn match rubyRegexpSpecial " \\ g<\% ([a-z_]\w *\| -\=\d\+\) >" contained display
133138syn match rubyRegexpSpecial " \\ g'\% ([a-z_]\w *\| -\=\d\+\) '" contained display
134139
135- syn cluster rubyStringSpecial contains =rubyInterpolation,rubyStringEscape
136- syn cluster rubyExtendedStringSpecial contains =@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets
137- syn cluster rubyRegexpSpecial contains =rubyInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment,rubyRegexpIntersection
140+ syn cluster rubyRegexpSpecial contains =@rubyStringSpecial,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment,rubyRegexpIntersection
138141
139142" Numbers {{{1
140143syn match rubyInteger " \% (\% (\w\| []})\" ']\s *\)\@ <!-\)\=\< 0[xX]\x\+\% (_\x\+\) *r\= i\=\> " display
@@ -367,7 +370,11 @@ syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contain
367370syn match rubyEncoding " [[:alnum:]-]\+ " contained display
368371syn match rubyMagicComment " \c\% <3l#\s *\z s\% (coding\| encoding\) :" contained nextgroup =rubyEncoding skipwhite
369372syn match rubyMagicComment " \c\% <10l#\s *\z s\% (frozen_string_literal\| warn_indent\| warn_past_scope\) :" contained nextgroup =rubyBoolean skipwhite
370- syn match rubyComment " #.*" contains =rubySharpBang,rubySpaceError,rubyTodo,rubyMagicComment,@Spell
373+ syn match rubyComment " #.*" contains =@rubyCommentSpecial,rubySpaceError,@Spell
374+
375+ syn cluster rubyCommentSpecial contains =rubySharpBang,rubyTodo,rubyMagicComment
376+ syn cluster rubyCommentNotTop contains =@rubyCommentSpecial,rubyEncoding
377+
371378if ! exists (" ruby_no_comment_fold" ) && s: foldable (' #' )
372379 syn region rubyMultilineComment start =" ^\s *#.*\n\% (^\s *#\)\@ =" end =" ^\s *#.*\n\% (^\s *#\)\@ !" contains =rubyComment transparent fold keepend
373380 syn region rubyDocumentation start =" ^=begin\z e\% (\s .*\)\= $" end =" ^=end\% (\s .*\)\= $" contains =rubySpaceError,rubyTodo,@Spell fold
0 commit comments