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 - Indentation-correcting paste is just a bug for text/xml
Summary: Indentation-correcting paste is just a bug for text/xml
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2003-12-09 02:24 UTC by Jesse Glick
Modified: 2007-11-05 13:44 UTC (History)
1 user (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 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