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 176948 - [68cat] "Delete Line" on last line causes caret to move to end of line
Summary: [68cat] "Delete Line" on last line causes caret to move to end of line
Status: REOPENED
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-16 13:47 UTC by matthies
Modified: 2016-07-18 20:31 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 matthies 2009-11-16 13:47:06 UTC
"Delete Line" (and line cutting with Ctrl+X) on the last line of a file causes the caret to be moved to end of the preceding line instead of maintaining its horizontal position or be moved to the beginning of the line.
Comment 1 Vitezslav Stejskal 2009-11-19 09:09:28 UTC
And why is the end of the previous line wrong?
Comment 2 matthies 2009-11-19 09:48:05 UTC
- It's different from the behavior for other (= non-last) lines.
- It means you can't cut the line, move the caret up, and just paste the line in again. You have to move the caret to the beginning of the line again first.
- If the previous line is longer than the visible editor width, jumping to it's end means that the line beginnings aren't visible any more. This is particularly inconvenient when deleting multiple lines from the end of the file (keeping Ctrl+X pressed for example): Not seeing the line beginnings means that you can't see well what you are deleting.
Comment 3 Vitezslav Stejskal 2009-11-20 04:46:28 UTC
Ok, thanks. So, would 'moved to the beginning of the line' be the preferred solution here? That should satisfy all the three points.
Comment 4 matthies 2009-11-20 09:58:14 UTC
Moving to the beginning of the line is probably the simplest solution, and would be satisfactory.

Maintaining the horizontal caret position, which would arguably be the best solution, necessitates further changes, such as doing the same for line copying, and making line pasting independent of the horizontal caret position. Basically this would mean that lines are turned into first-class objects, instead of merely being a text range that just happens to end in a newline. Some editors present that view, and it makes for a better usability, but requires the internal editor model to really cater to that view.
Comment 5 Martin Balin 2016-07-07 07:25:42 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
Comment 6 matthies 2016-07-18 20:31:07 UTC
Still reproducable in current dev build.