Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Annoying un-indent in HTML (Ruby - ERB) #28

Closed
sxua opened this Issue · 6 comments

7 participants

@sxua

Anytime you write some construction like this:

<% something do %>
  <% something_first %>
  <% something_second %>
<% end %>

The first string is always un-indenting during editing, and one always need to indent it again, after each edit.

<% something do %>
<% something_first %>
  <% something_second %>
<% end %>

This appears only in blocks, but not in this case (which is wrong):

<% something %>
  <% something_first %>
    <% something_second %>
@tbates

hi @sxua
What help do you need to make these changes and push them back to the core bundle? Join the irc channel and ask away, or ask here.

@brettchalupa

:+1: to getting this fixed.

@semaperepelitsa

To workaround this you can disable auto-indentation entirely. Unfortunately, this will affect Ruby source files as well. Go to Bundles → Edit Bundles, select Ruby → Settings. Now you need to un-tick "Enable this item" for the following ones: Folding (ERB), Folding (Ruby), Indent. Close, save and there you go. This will work immediately.

If anyone has better workarounds, please, share.

@tbates

So, the comments by @infininight on @tristanoneil 's pull ↑ explicate this.

The rule needs to be split off into a new set of indention rules specific for ERB so as to not muck up HTML and RUBY parsing outside of the ERB case.

@pch

:+1:
It'd be awesome if someone could fix this.

@sorbits sorbits closed this in 3b75627
@shinyaohtani

My TextMate doesn't indent ERB tags at all.
For example:
<% if @user.id == current_user.id %>
<%= image_tag @user.image %>
<% end %>

I expect:
<% if @user.id == current_user.id %>
 <%= image_tag @user.image %>
<% end %>

Linux vim indents HTML Ruby ERB correctly.
Does anyone solve this ERB indentation problem of TextMate?
(TextMate version 2.0-alpha.9399)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.