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 182648 - [69cat] Keyboard cursor keys broken (up/down)
Summary: [69cat] Keyboard cursor keys broken (up/down)
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: issues@editor
URL:
Keywords: REGRESSION
: 182654 182681 182684 182700 183119 183227 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-24 10:11 UTC by devarni
Modified: 2011-11-16 16:46 UTC (History)
13 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (30.90 KB, image/png)
2010-04-07 01:20 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description devarni 2010-03-24 10:11:34 UTC
Keyboardhandler is broken for up/down keys (cursor) since build 201003240200. 
Also some other exceptions for the text component (AssertionError: Null textComponent).

Seems that someone with their last commits has broken the editor?
Comment 1 Vladimir Voskresensky 2010-03-24 10:56:16 UTC
*** Bug 182654 has been marked as a duplicate of this bug. ***
Comment 2 Vladimir Voskresensky 2010-03-24 10:57:04 UTC
+ Ctrl+E removes not the current, but previous line
Comment 3 stefan79 2010-03-24 13:30:06 UTC
I´ve the same problem!

My Cursor-UP/Down works very strange:
-) Cursor-UP: 
    When I press Cursor-Up, the cursor jumps to the third line up. example: Cursor is at line 15, then I press Cursor-UP and then the Cursor is at Line 12
 
-) Cursor-Down:
    When I press Cursor-Down, the Cursor jumps at the previous line (this should Cursor-Up do).
 
Tested at Build 201003240200.
Restarting the IDE doesn´t help.
Comment 4 laurin1 2010-03-24 14:29:26 UTC
Same problem. Windows 7 x64
Comment 5 Chiana 2010-03-24 15:07:13 UTC
Aye, got this problem too, 03230200 seems to work as it should...
Comment 6 Jan Lahoda 2010-03-24 15:13:26 UTC
*** Bug 182681 has been marked as a duplicate of this bug. ***
Comment 7 Jan Lahoda 2010-03-24 15:17:06 UTC
A rounding bug: the new views (which paint the lines in the editor) use doubles
for layout, but JTextComponent.modelToView only uses integers. Truncation of
the doubles to integers causes the problems for the Up/Down. This should fix
Up/Down, End and Ctrl-E (+I tried to test simple navigation actions, and they
seem to work OK):
http://hg.netbeans.org/jet-main/rev/c51a4283e032

Please let me know if there is some other action broken. Thanks.
Comment 8 Jan Lahoda 2010-03-24 15:25:28 UTC
*** Bug 182684 has been marked as a duplicate of this bug. ***
Comment 9 Jesse Glick 2010-03-24 15:29:17 UTC
Workaround: -J-Dorg.netbeans.editor.linewrap.disable=true makes the editor work normally. I think vstejskal's d21f93e873b9 was premature, as there are several very visible bugs in linewrap mode.
Comment 10 Quality Engineering 2010-03-25 05:57:10 UTC
Integrated into 'main-golden', will be available in build *201003250201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/c51a4283e032
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #182648: fixing up/down, and end actions. JTextComponent modelToView truncates the precise double results - using precise double values by direct access to views.
Comment 11 Jan Lahoda 2010-03-25 15:07:30 UTC
*** Bug 182700 has been marked as a duplicate of this bug. ***
Comment 12 Maros Sandor 2010-03-30 09:41:15 UTC
While the behavior is better than last week, it still does not work for me. 
build: NetBeans IDE Dev (Build 201003290201)
hg ID: 1cf56aeaf085
system: Ubuntu 9.04
Comment 13 Miloslav Metelka 2010-03-30 15:41:29 UTC
I have fixed the code to round up the default line height computation to one decimal place which should not affect layout in any visible way but which could help to eliminate this problem. I leave the issue open until we verify that the problem is fixed.
http://hg.netbeans.org/jet-main/rev/d2bc552c51ed
Comment 14 Miloslav Metelka 2010-03-31 11:30:52 UTC
Fixed EditorUI.textLeftMarginWidth to zero value as pointed out by jlahoda in order to let methods in editor's Utilities properly traverse between lines boundaries.
http://hg.netbeans.org/jet-main/rev/e84ab2f4a661
Comment 15 Miloslav Metelka 2010-03-31 11:44:44 UTC
*** Bug 183227 has been marked as a duplicate of this bug. ***
Comment 16 Jan Lahoda 2010-03-31 12:34:00 UTC
*** Bug 183119 has been marked as a duplicate of this bug. ***
Comment 17 Jan Lahoda 2010-03-31 12:48:47 UTC
Unfortunately, it seems that the above fixes are still not enough. Will need to investigate further.
Comment 18 Jan Lahoda 2010-03-31 14:45:11 UTC
Bypassing a conversion from double to float:
http://hg.netbeans.org/jet-main/rev/1c72d1c2f537
Comment 19 Miloslav Metelka 2010-04-01 11:24:52 UTC
Rounding bounds-related computations to 1/8 of pixel. Also renamed defaultBaselineOffset -> defaultAscent.
http://hg.netbeans.org/jet-main/rev/71f839ae7563
Comment 20 Quality Engineering 2010-04-02 05:15:26 UTC
Integrated into 'main-golden', will be available in build *201004020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d2bc552c51ed
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #182648 - Keyboard cursor keys broken (up/down) - rounding default line height up to one decimal place.
Comment 21 David Strupl 2010-04-02 17:36:52 UTC
I think this should be fixed now (after 71f839ae7563). Please verify and if it is still there please reopen.
Comment 22 David Konecny 2010-04-07 01:19:57 UTC
It is fixed for me.

I do not know if it is relevant but if multiple lines are selected then one pixel white line is draw in between each selected line. See attached screenshot.
Comment 23 David Konecny 2010-04-07 01:20:41 UTC
Created attachment 96823 [details]
screenshot
Comment 24 David Konecny 2010-04-07 02:09:19 UTC
Also icon for libe breaking (in editor gutter) is slightly misplaced - it is about 5 pixels too high. Tested on:

  Product Version         = NetBeans IDE Dev (Build 100407-2b6de6b17c30) 
  Operating System        = Linux version 2.6.24-24-generic running on i386
  Java; VM; Vendor        = 1.6.0_17; Java HotSpot(TM) Client VM 14.3-b01;
Comment 25 Vitezslav Stejskal 2010-04-07 12:02:13 UTC
(In reply to comment #24)
> Also icon for libe breaking (in editor gutter) is slightly misplaced

issue #183536