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 268524 - Javascript: code indentation broken when I make a selection from the code completion window
Summary: Javascript: code indentation broken when I make a selection from the code com...
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-14 09:14 UTC by par7133
Modified: 2016-10-14 09:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (845.97 KB, text/plain)
2016-10-14 09:14 UTC, par7133
Details
after my "switch" selection (9.61 KB, image/png)
2016-10-14 09:18 UTC, par7133
Details

Note You need to log in before you can comment on or make changes to this bug.
Description par7133 2016-10-14 09:14:29 UTC
Product Version = NetBeans IDE 8.2 (Build 201609300101)
Operating System = Linux version 4.7.6-200.fc24.x86_64 running on amd64
Java; VM; Vendor = 1.8.0_101
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.101-b13

Reproducibility: Happens every time

STEPS:
  * I have the following indentation settings for all the languages:
      Expand Tabs to Spaces: yes
      Number of Spaces per indent: 2
      Tab Size: 2
    inherited by all the languages (PHP and Javascript included)
  * I'm in a PHP page with this Javascript code (please consider also the number of spaces included):
    function saveChanges(index, type) {

      switch      
  * I finish to type switch and I select the 'switch (key) {...sw' suggestion from the Code Completion window.
  * The code template subsequently appearing breaks the actual indentation in this way  (please consider also the number of spaces included):
    function saveChanges(index, type) {

      switch (key) {
    case value:
        
        break;

    default:
        
        break;
}
  * The problem seems related only to Javascript code

ACTUAL:
  the indentation of the suggested code is broken 

EXPECTED:
  the indentation of the code should be maintained
Comment 1 par7133 2016-10-14 09:14:38 UTC
Created attachment 162505 [details]
IDE log
Comment 2 par7133 2016-10-14 09:18:29 UTC
Created attachment 162506 [details]
after my "switch" selection