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 186007 - XML code completion: caret is not placed properly
Summary: XML code completion: caret is not placed properly
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC All
: P3 normal (vote)
Assignee: _ alexpetrov
URL:
Keywords:
: 185898 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-12 13:54 UTC by jcampbell
Modified: 2010-05-28 20:26 UTC (History)
2 users (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 jcampbell 2010-05-12 13:54:48 UTC
When typing in a pom.xml file and adding new xml elements to the file, the "code-completion" of pom.xml tags jumps to a newline when auto-completing an item.  In NetBeans 6.8, when editing a pom.xml and auto-completing an item, it would keep the caret on the same line.  This bug makes editing a pom.xml a BIG PAIN because you spend a LOT of unnecessary time repositioning your cursor.

Reproduce
1. Create a new Maven Project (such as "Maven Quickstart Archtype")
2. Open the pom.xml file
3. Create a new <dependency> section by adding a newline after an existing </dependency>
4. Type "<dep" (the completion popup will appear with "dependency" in the list)
5. Hit ENTER to select "dependency" from the list

Results
"<dependency>" is completed on the line and the cursor is position to the next line

Expected results
"<dependency" is completed on the line and the cursor remains on the same line (at the end of the completion. (example <dependency| ) AND after typing ">" a new completion popup appears with "</dependency>" in the list.  (the same behavior as NetBeans 6.8)
Comment 1 David Simonek 2010-05-12 14:54:51 UTC
While I agree that this issue can be annoying, this bug doesn't meet the criteria for being P1. Please don't abuse our priority standards and do your homework (=read priority guidelines). Thank you.

Btw you are right, version 6.8 did position the caret differently. However this is general issue of completion over xml files (try layer files for example), not related to Maven support, so reassigning.
Comment 2 Sergey Lunegov 2010-05-12 15:11:56 UTC
Alex, please take a look.
Comment 3 _ alexpetrov 2010-05-13 10:19:27 UTC
Fixed in trunk: http://hg.netbeans.org/main/rev/8775074ea6a9
Comment 4 Quality Engineering 2010-05-17 15:31:31 UTC
Integrated into 'main-golden', will be available in build *201005170932* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log:
Comment 5 David Simonek 2010-05-18 06:46:00 UTC
*** Bug 185898 has been marked as a duplicate of this bug. ***
Comment 6 Quality Engineering 2010-05-19 06:18:05 UTC
Integrated into 'main-golden', will be available in build *201005182201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log:
Comment 7 oakie3cr 2010-05-26 19:12:35 UTC
It correctly puts the cursor on the right line, however it is not between the elements. Compare with html completion.

To reproduce, create any xml element in an xml document, for example <foo>. If I create the <foo> element and then press ctrl-space I expect it to look like this:

<foo>|</foo>

where "|" is the location of the cursor. 

When completing in an html document, and when completing in 6.8 it works as expected. When completing in 6.9-rc1 the cursor is positioned like this (after the closing element):

<foo></foo>|

I have seen this on both windows and linux.
Comment 8 _ alexpetrov 2010-05-27 10:55:22 UTC
This bug related to the original description http://netbeans.org/bugzilla/show_bug.cgi?id=186007#c0 has been fixed.
Please file a new bug with new description according to http://netbeans.org/bugzilla/show_bug.cgi?id=186007#c7.
Comment 9 oakie3cr 2010-05-27 17:48:22 UTC
I don't believe that it does. The last sentence in the description says "the same behavior as NetBeans 6.8". It does not have the same behavior as netbeans 6.8. My comment was to clarify what the original description said. The current behavior still has the same problems as initially described because you still have to "spend a LOT of unnecessary time repositioning your cursor." The fix only addressed 1 aspect of the problem - putting the cursor on the following line. It did not address the rest of the issue - the positioning of the cursor for efficiency while editing xml documents.
Comment 10 jcampbell 2010-05-27 17:53:52 UTC
I would have to agree.... while the current FIX is MUCH better than the original bug, the FIX does a different behavior than NetBeans 6.8, and will cause the user to still have to potentially reposition the caret.
Comment 11 _ alexpetrov 2010-05-28 12:34:33 UTC
I'd like to explain why I'd prefer to get a new bug.

1. In my opinion the key words of the original bug are - "keep the caret on the same line" (it's a difference from NB 6.8 behaviour):
   "In NetBeans 6.8, when editing a pom.xml and auto-completing an item, it would keep the caret on the same line."
   I'm not sure that "a BIG PAIN because you spend a LOT of unnecessary time repositioning your cursor" is a real software bug (probably medical trouble).

2. The fix was already integrated into 'main-golden' and I think that another changing of source code should be marked with a new bug number.
Comment 12 oakie3cr 2010-05-28 19:04:26 UTC
I have created http://netbeans.org/bugzilla/show_bug.cgi?id=186916 as a follow up to this issue as requested.
Comment 13 _ alexpetrov 2010-05-28 20:26:54 UTC
Thank you.
The bug http://netbeans.org/bugzilla/show_bug.cgi?id=186916 has been fixed.