summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/eruby.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-30 10:51:39 +0100
committerBram Moolenaar <Bram@vim.org>2022-03-30 10:51:39 +0100
commit46eea444d992c2ae985cabb775a5d283f8e16df3 (patch)
tree60c149cee920e02a181c98dd0609b7598f535218 /runtime/syntax/eruby.vim
parent9247a221ce7800c0ae1b3487112d314b8ab79f53 (diff)
Update runtime files
Diffstat (limited to 'runtime/syntax/eruby.vim')
-rw-r--r--runtime/syntax/eruby.vim12
1 files changed, 5 insertions, 7 deletions
diff --git a/runtime/syntax/eruby.vim b/runtime/syntax/eruby.vim
index 6bb24fe562..3d1bf715db 100644
--- a/runtime/syntax/eruby.vim
+++ b/runtime/syntax/eruby.vim
@@ -3,9 +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
+" Last Change: 2022 Mar 18
-if &syntax !~# '\<eruby\>' || get(b:, 'current_syntax') =~# '\<eruby\>'
+if exists("b:current_syntax")
finish
endif
@@ -19,8 +19,6 @@ endif
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\+')
@@ -54,10 +52,10 @@ if !b:eruby_nest_level
let b:eruby_nest_level = 1
endif
-if get(b:, 'eruby_subtype', '') !~# '^\%(eruby\)\=$' && &syntax =~# '^eruby\>'
+if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? '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
@@ -72,7 +70,7 @@ exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:erub
hi def link erubyDelimiter PreProc
hi def link erubyComment Comment
-let b:current_syntax = matchstr(&syntax, '^.*\<eruby\>')
+let b:current_syntax = 'eruby'
if main_syntax == 'eruby'
unlet main_syntax