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

Closed
sxua opened this Issue Sep 5, 2012 · 6 comments

Comments

Projects
None yet
7 participants
@sxua

sxua commented Sep 5, 2012

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

This comment has been minimized.

Show comment Hide comment
@tbates

tbates Oct 31, 2012

Member

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.

Member

tbates commented Oct 31, 2012

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

This comment has been minimized.

Show comment Hide comment
@brettchalupa

brettchalupa Nov 30, 2012

👍 to getting this fixed.

👍 to getting this fixed.

@semaperepelitsa

This comment has been minimized.

Show comment Hide comment
@semaperepelitsa

semaperepelitsa Jan 21, 2013

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.

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

This comment has been minimized.

Show comment Hide comment
@tbates

tbates Jan 21, 2013

Member

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.

Member

tbates commented Jan 21, 2013

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

This comment has been minimized.

Show comment Hide comment
@pch

pch Jan 28, 2013

👍
It'd be awesome if someone could fix this.

pch commented Jan 28, 2013

👍
It'd be awesome if someone could fix this.

@sorbits sorbits closed this in 3b75627 Jan 28, 2013

@shinyaohtani

This comment has been minimized.

Show comment Hide comment
@shinyaohtani

shinyaohtani Mar 22, 2013

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)

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