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 181356 - "while" and "until" loops incorrectly indented
Summary: "while" and "until" loops incorrectly indented
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Mac OS X
: P3 normal (vote)
Assignee: issues@ruby
Depends on:
Reported: 2010-03-01 06:32 UTC by fjan11
Modified: 2011-01-28 20:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description fjan11 2010-03-01 06:32:48 UTC
The "while" and "until" loops get incorrect indentation in ruby if they contain the optional "do" keyword. If the "do" is removed it works correctly:

while x<5 do

This is ok:
while x<5
Comment 1 Erno Mononen 2010-03-01 07:37:53 UTC
Strange, the given example seems to work fine for me. Do you mean indentation after formatting or after pressing enter?
Comment 2 fjan11 2010-03-01 08:16:51 UTC
Ah, sorry, it seems it only happens when it is not the first statement on  a line, try this:

x=0;while x; do

It happens both when editing and after a reformat.
Comment 3 fjan11 2010-03-01 08:18:00 UTC
Oops, added a semi-colon too much; this is the snippet that format incorrectly:

x=0;while x do
Comment 4 Erno Mononen 2010-03-01 08:41:13 UTC
Thanks, I can reproduce this now. I'll try take a look at this at some point after 6.9 Beta (focusing on rails 3 support now).