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.
"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.
And why is the end of the previous line wrong?
- 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.
Ok, thanks. So, would 'moved to the beginning of the line' be the preferred solution here? That should satisfy all the three points.
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.
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
Still reproducable in current dev build.