summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/eruby.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-12 21:29:15 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-12 21:29:15 +0200
commitec7944aaf2d5fd67b7bd59a69d6a393424b6c8f8 (patch)
treed578871973ba7c87e0337dbe90b61d75de667100 /runtime/syntax/eruby.vim
parentcab465a6d7a7d158c99b04ddc81650b468d82227 (diff)
Update runtime files.
Diffstat (limited to 'runtime/syntax/eruby.vim')
-rw-r--r--runtime/syntax/eruby.vim13
1 files changed, 5 insertions, 8 deletions
diff --git a/runtime/syntax/eruby.vim b/runtime/syntax/eruby.vim
index 42c8b51065..c20b086ba5 100644
--- a/runtime/syntax/eruby.vim
+++ b/runtime/syntax/eruby.vim
@@ -1,9 +1,7 @@
" Vim syntax file
" Language: eRuby
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2010 Apr 15
-" URL: http://vim-ruby.rubyforge.org
-" Anon CVS: See above site
+" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
if exists("b:current_syntax")
@@ -18,13 +16,12 @@ if !exists("g:eruby_default_subtype")
let g:eruby_default_subtype = "html"
endif
-if !exists("b:eruby_subtype") && main_syntax == 'eruby'
+if &filetype =~ '^eruby\.'
+ let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
+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(&filetype,'^eruby\.\zs\w\+')
- endif
- if b:eruby_subtype == ''
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$')
endif
if b:eruby_subtype == 'rhtml'
@@ -61,7 +58,7 @@ syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,eruby
exe 'syn region erubyOneLiner matchgroup=erubyDelimiter start="^%\{1,'.b:eruby_nest_level.'\}%\@!" end="$" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend oneline'
exe 'syn region erubyBlock matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}%\@!-\=" end="[=-]\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend'
exe 'syn region erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}=\{1,4}" end="[=-]\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend'
-exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}#" end="%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=rubyTodo,@Spell containedin=ALLBUT,@erubyRegions keepend'
+exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}-\=#" end="[=-]\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=rubyTodo,@Spell containedin=ALLBUT,@erubyRegions keepend'
" Define the default highlighting.