Skip to content
Browse files

Kill trailing hyphens in ERB surroundings

I'm told newline trimming is the default in Rails 3.
  • Loading branch information...
1 parent f22e648 commit 4eca304a673396eb41106464a9b1c6f37fe1aea9 @tpope committed
Showing with 4 additions and 10 deletions.
  1. +4 −10 autoload/rails.vim
View
14 autoload/rails.vim
@@ -4506,14 +4506,8 @@ function! s:BufSettings()
if ft =~# '^eruby\>' || ft =~# '^yaml\>'
" surround.vim
if exists("g:loaded_surround")
- " The idea behind the || part here is that one can normally define the
- " surrounding to omit the hyphen (since standard ERuby does not use it)
- " but have it added in Rails ERuby files. Unfortunately, this makes it
- " difficult if you really don't want a hyphen in Rails ERuby files. If
- " this is your desire, you will need to accomplish it via a rails.vim
- " autocommand.
if self.getvar('surround_45') == '' || self.getvar('surround_45') == "<% \r %>" " -
- call self.setvar('surround_45', "<% \r -%>")
+ call self.setvar('surround_45', "<% \r %>")
endif
if self.getvar('surround_61') == '' " =
call self.setvar('surround_61', "<%= \r %>")
@@ -4522,9 +4516,9 @@ function! s:BufSettings()
call self.setvar('surround_35', "<%# \r %>")
endif
if self.getvar('surround_101') == '' || self.getvar('surround_101')== "<% \r %>\n<% end %>" "e
- call self.setvar('surround_5', "<% \r -%>\n<% end -%>")
- call self.setvar('surround_69', "<% \1expr: \1 -%>\r<% end -%>")
- call self.setvar('surround_101', "<% \r -%>\n<% end -%>")
+ call self.setvar('surround_5', "<% \r %>\n<% end %>")
+ call self.setvar('surround_69', "<% \1expr: \1 %>\r<% end %>")
+ call self.setvar('surround_101', "<% \r %>\n<% end %>")
endif
endif
endif

0 comments on commit 4eca304

Please sign in to comment.
Something went wrong with that request. Please try again.