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 129321 - Bookmarks are moved when the text is moved using Alt+Shift+Up/Down
Summary: Bookmarks are moved when the text is moved using Alt+Shift+Up/Down
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 6.x
Hardware: PC All
: P4 blocker (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-05 16:49 UTC by Petr Dvorak
Modified: 2016-07-07 07:31 UTC (History)
0 users

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 Petr Dvorak 2008-03-05 16:49:09 UTC
Product Version: NetBeans IDE Dev (Build 200803051205)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)

1. Create a bookmark in the text (for example in the java source code).
2. Select more lines of the text so that the bookmarked line is somewhere in the selection (no matter where, it is
better if it is in the middle).
3. Use a keyboard shortcut to move the text on line up/down (it is Alt+Shift+Up/Down in NB6.0).

The bookmark "jumps out" of the selection - which is wrong itself - and it cannot be placed back by just an inverse
action ("alt+shift+up > alt+shift+down" does not place the bookmark back to the original position). As a bookmark should
be associated with the line itself, not with the line number, it should be moved all along with the same line.
Comment 1 Vitezslav Stejskal 2008-03-06 11:10:45 UTC
Although not surprising - moving lines up/down in fact removes them from the document and puts them back at the
different location - the behavior is obviously wrong. I don't think this one is really serious, P4. If you disagree push
the prio up again, please.
Comment 2 Petr Dvorak 2008-03-06 13:03:18 UTC
Well... I don't know... I think we can leave P4, but I also think the fix should be simple (I know you know better).

I have never used bookmarks while programming. But if someone places a bookmark in the middle of the class, then he/she
attempts to move the class using the shortcut (for example he/she wants to move encapsulated class above some property
in the class), the bookmarks just jump away of the class - this might be really confusing if someone is used to the
bookmarks...
Comment 3 Petr Dvorak 2008-03-07 17:42:52 UTC
One more think - suppose that you extend the example from the description 1:

1. Create several bookmarks in the code (i.e. 10-20)
2. Select the code so that it contains all the bookmarks
3. Move the code by one line using Alt+Shift+Up/Down

All of the bookmarks are placed out of the moved code and to the same line. So there is 10 bookmarks on a single line.
Well, it does not cause any raised exceptions (or can it?), but one might ask a question "Why cannot I remove this
bookmark?" or "Why the "jump to the previous/next bookmark" action does not work?" or "Why almost all of my bookmarks
have disappeared?". The answer to these questions is always the same: "As the bookmarks were moved wrongly and there is
more bookmarks at a single line."

I still can agree with the priority (P4), but I also think it would be nice (and also not so hard), if this issue was
fixed in the NB6.1 Final.
Comment 4 Vitezslav Stejskal 2008-03-11 12:48:28 UTC
You are right in some situations several bookmarks may end up at the same line. See for example issue #5342 or issue #60390.
Comment 5 Petr Dvorak 2008-03-11 13:02:10 UTC
Hmmm, I see. There's a really a "problem" with the bookmarks... Well, I think that the first step might be removing
bookmarks from the bookmark container so that there could be only one bookmark on the line. It could be used in
combination with a bookmark history (if a bookmark is removed in some point because of another bookmark on the same
line, the undo can re-add it in the right moment).

Well, it is actually also a good question - should the event "Toogle bookmark" be stored in the "undo" history, or would
it be confusing?

As I say: I have never used bookmarks myself... An opinion of someone who uses it would be probably helpful.
Comment 6 David Strupl 2009-03-31 15:46:49 UTC
Resolving all issues with milestone "future" as LATER. If you feel strongly that
it should be implemented please reopen and set the target milestone to "next".
Comment 7 Quality Engineering 2009-11-02 10:55:12 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX
Comment 8 Petr Dvorak 2009-11-13 10:53:28 UTC
Reopening with low priority. The issue is still there, but it can wait I guess.
Comment 9 Martin Balin 2016-07-07 07:31:32 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss