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 250041 - Wrong indentation on a new line with "New Line Indented" settings
Summary: Wrong indentation on a new line with "New Line Indented" settings
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-27 07:41 UTC by Vladimir Riha
Modified: 2015-09-09 11:22 UTC (History)
2 users (show)

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 Vladimir Riha 2015-01-27 07:41:29 UTC
Please try to set JavaScript->Braces formatting for "while/do" to "New Line indented". Paste following to JS file

do
    {
        console.log(1);
    } while (true);


format it and press Enter after the ";" on line with "while(true);", new line indentation should be 0, but it actually is


do
    {
        console.log(1);
    } while (true);
    |


where | is cursor position.


Thank you



Product Version: NetBeans IDE Dev (Build web-main-1841-on-20150127)
Java: 1.8.0_25; Java HotSpot(TM) Client VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b17
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2015-01-27 07:45:33 UTC
It seems to be common issue when braces placement is set to "New Line indented", the same happens e.g. after if

if (expr)
    {

    }


or switch

switch (key)
    {
        case value:


            break;

        default:

            break;
    }