diff options
Diffstat (limited to 'runtime/ftplugin/eruby.vim')
-rw-r--r-- | runtime/ftplugin/eruby.vim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/ftplugin/eruby.vim b/runtime/ftplugin/eruby.vim index 9e121c20b..7c19a09aa 100644 --- a/runtime/ftplugin/eruby.vim +++ b/runtime/ftplugin/eruby.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: eRuby -" Maintainer: Tim Pope <vimNOSPAM@tpope.info> -" Info: $Id: eruby.vim,v 1.12 2008/06/29 04:18:43 tpope Exp $ +" Maintainer: Tim Pope <vimNOSPAM@tpope.org> +" Last Change: 2010 Apr 15 " URL: http://vim-ruby.rubyforge.org " Anon CVS: See above site " Release Coordinator: Doug Kearns <dougkearns@gmail.com> @@ -27,7 +27,10 @@ if !exists("b:eruby_subtype") 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\)\+$','',''),'\.\zs\w\+$') + 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' let b:eruby_subtype = 'html' |