Skip to content

Commit

Permalink
Guard against recursion in eruby files
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Apr 25, 2008
1 parent 6219f66 commit a2196f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
2008-04-25 Tim Pope <vim@tpope.info>

* ftplugin/eruby.vim, syntax/eruby.vim: guard against recursion

2008-04-21 Tim Pope <vim@tpope.info>

* indent/eruby.vim: don't let ruby indent %> lines
Expand Down
2 changes: 1 addition & 1 deletion ftplugin/eruby.vim
Expand Up @@ -27,7 +27,7 @@ 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\)\+$','',''),'\.\zs\w\+$')
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\)\+$','',''),'\.\zs\w\+$')
endif
if b:eruby_subtype == 'rhtml'
let b:eruby_subtype = 'html'
Expand Down
2 changes: 1 addition & 1 deletion syntax/eruby.vim
Expand Up @@ -22,7 +22,7 @@ if !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\)\+$','',''),'\.\zs\w\+$')
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\)\+$','',''),'\.\zs\w\+$')
endif
if b:eruby_subtype == 'rhtml'
let b:eruby_subtype = 'html'
Expand Down

0 comments on commit a2196f5

Please sign in to comment.