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

Summary: Wrong indentation on a new line with "New Line Indented" settings
Product: javascript Reporter: Vladimir Riha <vriha>
Component: Formatting & IndentationAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal CC: ppisl, rsvitanic
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

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;
    }