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 242115

Summary: With line wrap enabled, cursor at end of line is painted at beginning of next line instead
Product: editor Reporter: ebakke
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: REOPENED ---    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description ebakke 2014-02-19 19:00:41 UTC
In an editor with line wrap enabled, the cursor is shown at the wrong physical location whenever it is supposed to be located at the end of a wrap line. Instead of being painted at the end of the wrap line, it is painted at the beginning of the following line. This causes the behavior of keyboard shortcuts like "End" and "Up" to seem nonsensical to the user, although they might well be behaving correctly wrt. the physical location of the cursor (the character offset).

To reproduce:
1) Go to Options/Preferences->Editor->Formatting, select "All Languages" and set "Line Wrap" to "After words". Click OK.
2) Create a new plain text file and open it in the editor.
3) Type some gibberish into the editor on a single line that is long enough to be broken into several break lines.
4) With the cursor on the first break line, press the "End" key (Command+Right on MacBook keyboards). The cursor appears to move one line down, which is unexpected. From looking at this situation, the user would now assume that they could press the "Up" key to move the cursor back to the previous break line, but this will not change the cursor position (because the cursor is logically on the previous line).
Comment 1 Martin Balin 2016-07-07 07:30:27 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 2 ebakke 2016-07-07 17:23:00 UTC
Still reproducible on latest build; reopening.

Specific bugs currently observed:
* Pressing End with cursor before the first character of a wrapped paragraph moves cursor down instead of to the end of the line.
* Pressing Home anywhere in a paragraph will move the cursor to the first character on the paragraph rather than at the first character of the wrap line.

Pressing "Up" with the cursor on the first character of a wrap line seems to work correctly now, though.

Product Version: NetBeans IDE Dev (Build 201607070002)
Java: 1.8.0_92; Java HotSpot(TM) 64-Bit Server VM 25.92-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_92-b14
System: Mac OS X version 10.9.5 running on x86_64; UTF-8; en_US (nb)
Comment 3 ebakke 2018-06-22 19:35:31 UTC
This bug has been migrated to the JIRA issue .