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 199960

Summary: cursor move problems, line wrap problems
Product: editor Reporter: err <err>
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: RESOLVED DUPLICATE    
Severity: normal CC: emi, MindTwister, mmirilovic, nof8, zolta
Priority: P3    
Version: 7.1   
Hardware: All   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: example file with wrapping problems
example to show where word wrap fails

Description err 2011-07-07 22:24:44 UTC
Created attachment 109306 [details]
example file with wrapping problems

Probably introduced by Bug 197534.

Starting with an empty userdir. Open project, open file. I've attached the file that I used, but doubt you need it.

- Start the IDE, don't import anything (no jvi), open project, open the file
- Shrink the editor window so it holds 18 lines, 28 columns
- scroll down so line 60 is in the middle of the window,
  that's around some javax.swing.text... lines
- Set line wrap to "Anywhere"
Observe: the layout changes around these "import" lines to make room for the wrapped data, but there is no wrapped data displayed. Horizontal scroll bar present and does stuff.

- scroll down a little to where "class Main" is display
Observe: thing don't look right

- with the cursor at the first column, move the cursor down using the
  down arrow key until
        = "viHWrapPrevious";
  is displayed as the first line. This is the end of a wrapped line.
  Cursor at the bottom of the screen, on first part of line 78.
Observe: line 78, bottom of window wraps early (remember Anywhere is set).
         Just scrolling around in here is strange sometimes.
- cursor up until cursor at top of window, don't cause window to scroll.
Observe: last line on screen disapears. (Bug 199948 ?)
         sometimes it disapears at when cursor in other positions.

- closed file (empty editor mode)/ reponed the wrap-anywhere still didn't
  take effect correctly.

- with cursor around line 90, changed option from wrap-anywhere to wrap-word.
  Saw some screen redraw.
- click on a line in lower part of screen around column 20.
  Do a bunch of cursor up, I see a stuck cursor around line 90.
  Note that if cusror starts in col 0, then it won't get stuck.

Wrap seem to have worst behavior around '//' lines.

Things vary...

Product Version: NetBeans IDE Dev (Build 20110707-fe11ee71fe56)
Java: 1.6.0_23; Java HotSpot(TM) Client VM 19.0-b09
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\TEST
Comment 1 err 2011-07-07 23:09:51 UTC
Interestingly, in jVi the switch between anywhere/word wrap works ok.

BTW, there seem to be different drawing problems in jVi. In particular, move the cursor left/right over the first part of a line that is wrapped (no scrolling), and part of the line inconsistently disapears. This is the line in the last example where I said "last line on screen disapears".
Comment 2 Miloslav Metelka 2011-07-08 16:09:41 UTC
Apologies for regression caused by 197534. "Anywhere" word-wrap does not work properly. I will fix ASAP.
Comment 3 err 2011-07-08 16:19:48 UTC
(In reply to comment #2)
> Apologies for regression caused by 197534. "Anywhere" word-wrap does not work
> properly. I will fix ASAP.

No problem; when I'm in jVi, switching to "Anywhere" works pretty well. So looks like a simple issue that's really not part of the guts of the performance improvements.

After this first round of bugs is cleared up, I'll try to pinpoint specific issues that remain.
Comment 4 err 2011-07-14 19:57:15 UTC
With jVi I didn't see any painting problems. Removing that from summary. In wrap anywhere mode, lines were too long by a few characters.

With normal NB mode, jVi deactivated, cursor keys don't work at all.

I didn't delete userdir before checking.

Product Version: NetBeans IDE Dev (Build 20110714-9814cbf0a243)
Java: 1.6.0_23; Java HotSpot(TM) Client VM 19.0-b09
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\dev
Comment 5 zolta 2011-08-16 08:59:14 UTC
Created attachment 110002 [details]
example to show where word wrap fails
Comment 6 Miloslav Metelka 2011-09-20 12:56:50 UTC
There was a problem regarding HighlightsView.breakView() that led to missing view fragments where they normally should appear.
http://hg.netbeans.org/jet-main/rev/e9a0a8978a33

Additional fix will folow for cursor movements.
Comment 7 Quality Engineering 2011-09-22 14:54:27 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/e9a0a8978a33
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #199960 - cursor move problems, line wrap problems - fixed HighlightsView.breakView().
Comment 8 Miloslav Metelka 2011-10-10 15:30:24 UTC
*** Bug 198969 has been marked as a duplicate of this bug. ***
Comment 9 Miloslav Metelka 2011-10-10 15:49:29 UTC
*** Bug 198501 has been marked as a duplicate of this bug. ***
Comment 10 Miloslav Metelka 2011-11-23 10:01:02 UTC
So far I was only able to reproduce a following problem:
1) Turn on line wrapping (e.g. after-words) and goto a wrapped line.
2) Press End key to go to end of wrapped line.
3) Press cursor up; cursor goes to line begining.
4) Press cursor up again; cursor stays at line begining. Situation can be resolved by pressing e.g. Home key.

IMHO this could be considered P3. For the next version I would like to fix the caret to not be at the line begining but at the line end in case End key is pressed (although e.g. line-wrapped JTextArea behaves like NB editor). But I need to modify BaseCaret to carry a bias for that.
Comment 11 David Strupl 2012-11-06 15:27:22 UTC
The last described problem is already tracked as 199987 --> closing this report as duplicate.

*** This bug has been marked as a duplicate of bug 199987 ***