Mercurial > ec-dotfiles
diff vendor/vim-syntax/eruby.vim @ 623:0f0bdbd8d37d
Update syntax files
Additionally nginx repo fixed their cookie thingie.
author | nanaya <me@nanaya.pro> |
---|---|
date | Mon, 04 Mar 2019 20:01:03 +0900 |
parents | 0e72765944d4 |
children | 6cdd7d26260d |
line wrap: on
line diff
--- a/vendor/vim-syntax/eruby.vim Sun Dec 02 01:27:28 2018 +0900 +++ b/vendor/vim-syntax/eruby.vim Mon Mar 04 20:01:03 2019 +0900 @@ -3,8 +3,9 @@ " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2018 Jul 04 -if exists("b:current_syntax") +if &syntax !~# '\<eruby\>' || get(b:, 'current_syntax') =~# '\<eruby\>' finish endif @@ -18,11 +19,13 @@ if &filetype =~ '^eruby\.' let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+') +elseif &filetype =~ '^.*\.eruby\>' + let b:eruby_subtype = matchstr(&filetype,'^.\{-\}\ze\.eruby\>') elseif !exists("b:eruby_subtype") && main_syntax == 'eruby' let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') if b:eruby_subtype == '' - let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$') + let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\|\.example\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$') endif if b:eruby_subtype == 'rhtml' let b:eruby_subtype = 'html' @@ -41,16 +44,20 @@ endif if !exists("b:eruby_nest_level") - let b:eruby_nest_level = strlen(substitute(substitute(substitute(expand("%:t"),'@','','g'),'\c\.\%(erb\|rhtml\)\>','@','g'),'[^@]','','g')) + if &syntax =~# '\<eruby\.eruby\>' + let b:eruby_nest_level = strlen(substitute(substitute(&filetype,'\C\<eruby\>','@','g'),'[^@]','','g')) + else + let b:eruby_nest_level = strlen(substitute(substitute(substitute(expand("%:t"),'@','','g'),'\c\.\%(erb\|rhtml\)\>','@','g'),'[^@]','','g')) + endif endif if !b:eruby_nest_level let b:eruby_nest_level = 1 endif -if exists("b:eruby_subtype") && b:eruby_subtype != '' +if get(b:, 'eruby_subtype', '') !~# '^\%(eruby\)\=$' && &syntax =~# '^eruby\>' exe "runtime! syntax/".b:eruby_subtype.".vim" - unlet! b:current_syntax endif +unlet! b:current_syntax syn include @rubyTop syntax/ruby.vim syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment @@ -65,7 +72,7 @@ hi def link erubyDelimiter PreProc hi def link erubyComment Comment -let b:current_syntax = 'eruby' +let b:current_syntax = matchstr(&syntax, '^.*\<eruby\>') if main_syntax == 'eruby' unlet main_syntax