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 268431 - code indentation broken of the first line of pasted code
Summary: code indentation broken of the first line of pasted code
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-09 17:24 UTC by par7133
Modified: 2016-10-09 19:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (425.10 KB, text/plain)
2016-10-09 17:24 UTC, par7133
Details
code before the prb happen (23.45 KB, image/png)
2016-10-09 19:03 UTC, par7133
Details
code after the prb happen (23.33 KB, image/png)
2016-10-09 19:03 UTC, par7133
Details

Note You need to log in before you can comment on or make changes to this bug.
Description par7133 2016-10-09 17:24:54 UTC
Product Version = NetBeans IDE 8.2 (Build 201609300101)
Operating System = Linux version 4.7.5-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):
    $(document).ready(function() {

      function displayError(errNo, errMsg, errScript, errLine) {
        
        if (errNo==="") return;
        
        // Make of the error message string..
        if (errMsg!=="" && errScript!=="" && errLine!=="") {
          etc.
  * At the end of the line "        if (errNo==="") return;", I press [Enter] and the cursor positions itself
    at the beginning of the new line just under the "if". 
  * When I past the following two lines of code (please consider also the number of spaces included):
        // First, hide all the current error messages
        clearErrors();
     the indentation of the first line is broken from 8 spaces to 16 spaces.
  * Same result in PHP code
  * Same result in NetBeans 8.1 

ACTUAL:
  the indentation of the first line of pasted code get broken to the sum of spaces between the existing and the pasted ones

EXPECTED:
  the indentation of the pasted code must adapt to the existing indentation
Comment 1 par7133 2016-10-09 17:24:58 UTC
Created attachment 162412 [details]
IDE log
Comment 2 par7133 2016-10-09 19:03:08 UTC
Created attachment 162413 [details]
code before the prb happen
Comment 3 par7133 2016-10-09 19:03:42 UTC
Created attachment 162414 [details]
code after the prb happen