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 228311 - pasting elements into an XML file incorrectly opens code completion
Summary: pasting elements into an XML file incorrectly opens code completion
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.4
Hardware: PC All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-05 22:08 UTC by athompson
Modified: 2013-05-28 15:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
CC opens after pasting "dependency" element (232.03 KB, image/png)
2013-05-10 23:55 UTC, athompson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2013-04-05 22:08:17 UTC
IIRC this is a regression from eons ago--I vaguely remember reporting this before and it being fixed.
Comment 1 Svata Dedic 2013-04-11 09:23:04 UTC

*** This bug has been marked as a duplicate of bug 152237 ***
Comment 2 Svata Dedic 2013-04-12 08:50:01 UTC
Incorrectly duplicated; apologies.
Comment 3 Svata Dedic 2013-05-10 07:38:36 UTC
Please provide a scenario in which the CC open is unwanted: copying an entire element (incl. closing tag) or opened element with some content (even whitespace) trailing does not open CC:
CC opens if an opening tag is copied to the document at the end of the pasted string, and CC suggests either a child, or closing tag for it.
Comment 4 athompson 2013-05-10 23:55:47 UTC
Created attachment 134310 [details]
CC opens after pasting "dependency" element

You can reproduce this by pasting a complete element in a POM file. In this case, I simply copied and pasted the existing javaee dependency.
Comment 5 Svata Dedic 2013-05-24 12:57:51 UTC
Aha, OK. 
The trouble is that the CC is invoked much context. However I can use a trick: when the user types text into the editor manually, typically chars are entered one by one (event fired for each of them). I noticed that no CC: displays if the pasted text ends with a non-whitespace character (e.g. paste block ends right after closing ">" character). 

So I am changing the autoquery detection so that it will not pop up completion if the typed text ends with whitespace. Let's see if some other scenarios don't break;
Comment 6 Svata Dedic 2013-05-24 13:08:28 UTC
Fixed in http://hg.netbeans.org/jet-main/rev/de3d79fc00a5
Comment 7 Svata Dedic 2013-05-24 13:08:46 UTC
(not specific to MacOS X)
Comment 8 Quality Engineering 2013-05-26 02:23:56 UTC
Integrated into 'main-golden', will be available in build *201305252300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/de3d79fc00a5
User: Svata Dedic <sdedic@netbeans.org>
Log: #228311: do not open cc: when text with trailing ws is inserted
Comment 9 athompson 2013-05-28 15:36:08 UTC
Yup.