@@ -61,7 +61,7 @@ com! -nargs=* SynFold call s:run_syntax_fold(<q-args>)
6161
6262" }}}
6363
64- syn cluster rubyNotTop contains =@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo,rubyModuleName,rubyClassName,rubySymbolDelimiter
64+ syn cluster rubyNotTop contains =@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyEncoding
6565
6666" Whitespace Errors {{{1
6767if exists (" ruby_space_errors" )
@@ -361,9 +361,12 @@ if !exists("ruby_no_special_methods")
361361endif
362362
363363" Comments and Documentation {{{1
364- syn match rubySharpBang " \% ^#!.*" display
365- syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
366- syn match rubyComment " #.*" contains =rubySharpBang,rubySpaceError,rubyTodo,@Spell
364+ syn match rubySharpBang " \% ^#!.*" display
365+ syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
366+ syn match rubyEncoding " [[:alnum:]-]\+ " contained display
367+ syn match rubyMagicComment " \c\% <3l#\s *\z s\% (coding\| encoding\) :" contained nextgroup =rubyEncoding skipwhite
368+ syn match rubyMagicComment " \c\% <10l#\s *\z s\% (frozen_string_literal\| warn_indent\| warn_past_scope\) :" contained nextgroup =rubyBoolean skipwhite
369+ syn match rubyComment " #.*" contains =rubySharpBang,rubySpaceError,rubyTodo,rubyMagicComment,@Spell
367370if ! exists (" ruby_no_comment_fold" ) && s: foldable (' #' )
368371 syn region rubyMultilineComment start =" ^\s *#.*\n\% (^\s *#\)\@ =" end =" ^\s *#.*\n\% (^\s *#\)\@ !" contains =rubyComment transparent fold keepend
369372 syn region rubyDocumentation start =" ^=begin\z e\% (\s .*\)\= $" end =" ^=end\% (\s .*\)\= $" contains =rubySpaceError,rubyTodo,@Spell fold
@@ -431,6 +434,8 @@ hi def link rubyPseudoVariable Constant
431434hi def link rubyCapitalizedMethod rubyLocalVariableOrMethod
432435
433436hi def link rubyComment Comment
437+ hi def link rubyEncoding Constant
438+ hi def link rubyMagicComment SpecialComment
434439hi def link rubyData Comment
435440hi def link rubyDataDirective Delimiter
436441hi def link rubyDocumentation Comment
0 commit comments