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 37870

Summary: Indentation-correcting paste is just a bug for text/xml
Product: editor Reporter: Jesse Glick <jglick>
Component: -- Other --Assignee: issues@editor <issues>
Status: VERIFIED FIXED    
Severity: blocker CC: issues
Priority: P3 Keywords: REGRESSION
Version: 3.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Jesse Glick 2003-12-09 02:24:07 UTC
[recent dev builds]

For XML documents, the indentation engine does not
work. Therefore if you copy and paste text, it is
wrongly "undented". E.g. you start with

<foo>
    <bar/>
</foo>

Copy the whole line containing <bar/> and paste it
right after the first one. Expect:

<foo>
    <bar/>
    <bar/>
</foo>

but get:

<foo>
    <bar/>
<bar/>
</foo>

I.e. the entire selection when pasted is always
aligned to column 0.

This is worse than doing nothing - at least
before, the indentation was often right to begin
with, and if it wasn't, you could select the
pasted block and use Ctrl-D or Ctrl-T some number
of times to correct it. Now all the indentation is
lost, so e.g. after pasting the middle three lines in

<foo>
<bar>
<baz/>
</bar>
</foo>

it takes that much more work to correct it to

<foo>
    <bar>
        <baz/>
    </bar>
</foo>

e.g. by selecting the three lines, pressing
Ctrl-T, then selecting <baz/> and pressing Ctrl-T
again.
Comment 1 Ondrej Rypacek 2003-12-10 16:03:35 UTC
There was a bug in the indentation function. Fixed so that the
indentation is a homomorphism on formating engines :-D 
In other words, if the formatter does nothing, so does the indentation. 

Checked in 
1.101     +2 -3      editor/libsrc/org/netbeans/editor/BaseKit.java

Comment 2 Jesse Glick 2003-12-10 17:47:47 UTC
Don't forget target milestone.
Comment 3 Jiri Prox 2006-04-07 09:07:16 UTC
Verified