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 70253 - Caret moves back to top when pressing down key on the last line
Summary: Caret moves back to top when pressing down key on the last line
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: issues@editor
URL:
Keywords: REGRESSION
: 70311 70397 70430 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-12 10:47 UTC by Roman Strobl
Modified: 2007-11-05 13:44 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 Roman Strobl 2005-12-12 10:47:51 UTC
[NetBeans 200512111900; WinXP; JDK 1.6.0-b61]

Issue Summary:
--------------
Caret moves back to the first line when pressing the down key on last line in
editor. You need to be on second or consequent column, it works fine on first
column (caret stops).

Steps to Reproduce:
-------------------
1. Create a new class, e.g.
public class Main {
   | 
}
2. Go to place designated by |.
3. Press down arrow twice.
-> The caret goes to the first row on second key press.
Comment 1 Milan Kubec 2005-12-13 08:51:11 UTC
It's regression against Beta2.
Comment 2 Martin Roskanin 2005-12-13 10:26:46 UTC
*** Issue 70311 has been marked as a duplicate of this issue. ***
Comment 3 Martin Roskanin 2005-12-13 12:43:09 UTC
fixed in [maintrunk]

The problem was caused by the fix of the issue #69672
It seems that the best solution for fixing this issue, at the current state of
HR, is simple rollback, because there are several places in the editor code that
depends on returned null from modelToView. 

Mila, Roman, could you please review/test this? Thanks.

/cvs/editor/libsrc/org/netbeans/lib/editor/view/GapBoxView.java,v  <-- 
GapBoxView.java
new revision: 1.15; previous revision: 1.14

RCS file: /cvs/editor/libsrc/org/netbeans/lib/editor/view/GapBoxView.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- GapBoxView.java	11 Dec 2005 11:01:15 -0000	1.14
+++ GapBoxView.java	13 Dec 2005 12:34:32 -0000	1.15
@@ -1484,7 +1484,7 @@
             ret = cv.modelToView(pos, ca, b);
  
         } else {
-            ret = new Rectangle();
+            ret = null;
         }
 
         return ret;

Comment 4 Miloslav Metelka 2005-12-14 10:38:53 UTC
I agree with the fix. At this stage it's the most reliable solution.
Comment 5 Martin Roskanin 2005-12-14 13:13:49 UTC
*** Issue 70397 has been marked as a duplicate of this issue. ***
Comment 6 Roman Strobl 2005-12-14 15:08:24 UTC
Verified in trunk build 200512131900. I agree with fixing in the release50 branch.
Comment 7 Martin Roskanin 2005-12-14 15:36:52 UTC
integrated into [release50]

/cvs/editor/libsrc/org/netbeans/lib/editor/view/GapBoxView.java,v  <-- 
GapBoxView.java
new revision: 1.14.2.1; previous revision: 1.14
Comment 8 Martin Roskanin 2005-12-15 08:18:54 UTC
*** Issue 70430 has been marked as a duplicate of this issue. ***
Comment 9 Max Sauer 2005-12-23 11:32:52 UTC
Verified in 5.0 200512222030.
Comment 10 Max Sauer 2005-12-23 11:40:44 UTC
Verified also in trunk build 200512221900.