This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 131346 - HTML is indented wrongly if tabs are set to 2 spaces
Summary: HTML is indented wrongly if tabs are set to 2 spaces
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: RHTML (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-27 22:41 UTC by arturaz
Modified: 2011-01-28 20:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arturaz 2008-03-27 22:41:05 UTC
Steps to reproduce:

1. Download NB 6.0.1 or http://deadlock.netbeans.org/hudson/job/trunk/lastSuccessfulBuild/artifact/nbbuild/dist/zip/
2. Tools>Options>Editor>Indentation>Number of spaces per indent = 2, tab size = 2
3. Open up a html file (I tried index.html.erb) and paste this code

{{{
<% form_for :model do |f| %>
  <fieldset>
    <legend>Header</legend>
  
    <%= error_messages_for :model %>
  
    <ul>
      
      <li class="submit"><%= submit_tag "Siųsti" %></li>
    </ul>
  </fieldset>
<% end %> 
}}}

4. Define a Ruby code template (I called it ffi):
{{{
<li>
  <label for="${model}_${attr}">${Title}</label>
  <span><%= ${f}.${text_field} :${attr} %></span>
</li>
}}}

5. Put the cursor in the blank line after ul tag.
6. Type ffi<TAB>

Expected result:
{{{
<% form_for :model do |f| %>
  <fieldset>
    <legend>Header</legend>
  
    <%= error_messages_for :model %>
  
    <ul>
      <li>
        <label for="model_attr">Title</label>
        <span><%= f.text_field :attr %></span>      
      </li> 
      <li class="submit"><%= submit_tag "Siųsti" %></li>
    </ul>
  </fieldset>
<% end %> 
}}}

Actual result:
{{{
<% form_for :model do |f| %>
  <fieldset>
    <legend>Header</legend>
  
    <%= error_messages_for :model %>
  
    <ul>
      <li>
          <label for="model_attr">Title</label>
          <span><%= f.text_field :attr %></span>
        </li> 
      <li class="submit"><%= submit_tag "Siųsti" %></li>
    </ul>
  </fieldset>
<% end %> 
}}}

As you can see, everything after li is intented wrongly.
Comment 1 arturaz 2008-03-28 13:28:21 UTC
Err, mistype, when i typed "Ruby code template" I actually meant "RHTML code template".
Comment 2 Erno Mononen 2009-05-19 15:01:11 UTC
Still valid.