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 234664 - Rectangular selection fails to work properly on big file
Summary: Rectangular selection fails to work properly on big file
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-20 15:33 UTC by MackSix
Modified: 2016-07-07 07:26 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Big property file to use for reproduction in zip. (36.32 KB, application/x-zip-compressed)
2013-08-20 15:33 UTC, MackSix
Details
Screenshot (75.38 KB, image/png)
2013-08-20 15:35 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2013-08-20 15:33:29 UTC
Created attachment 138929 [details]
Big property file to use for reproduction in zip.

1. Open up attached properties file.
2. Toggle Rectangular Selection on.
3. Put cursor on the right side next to the equal sign.
4. Press Ctrl+Shift+End and the rectangular selection is extended to the end of
the rows and the cursor is at the end of the last row.
5. Release Ctrl and while pressing Shift, move cursor back to the left with the 
left arrow key.
6. The rectangular selection will snap to the cursor, but keep moving to the left 
and make the rectangular selection a vertical line.
7. Release Shift key and press the space bar.
8. A space is added, but the rectangular selection jumps to the far left and 
two subsequent presses of Space removes the first line in the file. Then 
subsequent presses of Space do nothing except hang Netbeans for a second or two.

Expected: Rectangular selection does not jump to the far left and subsequent presses of the Space key ads more space to the column. This behaves correctly in a small file. 

Product Version: NetBeans IDE Dev (Build 201308192300)
Updates: Updates available
Java: 1.7.0_40-ea; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-ea-b38
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 MackSix 2013-08-20 15:35:43 UTC
Created attachment 138930 [details]
Screenshot

Screenshot shows rectangular selection's location after pressing Space. Also, see extraneous tail on rectangular selection that should not be there. If it is not there, scroll up and then back down and it should be there.
Comment 2 MackSix 2013-08-20 18:24:57 UTC
There is also a problem with Backspace when trying to expand/contract width of rectangular selection.The same sort of result happens after step #4 above--the rectangular selection jumps to the far left.
Comment 3 Svata Dedic 2013-08-30 11:49:36 UTC
The problem can be narrowed to a much smaller file. For some reason the operation works OK if the selection block is < 80 lines tall. Once the selection expands from line #1 to line #80 (including), typing a character resets selection block to start of the line.
Comment 4 Svata Dedic 2013-08-30 15:26:21 UTC
The reason for the behaviour is that after certain number of operations within the atomic lock, the view model will cease to update because of performance reasons. Code which recomputes the selection area and repaints the screen then fails to obtain correct on-screen coordinates, since it executes within the atomic lock.

Fixed in http://hg.netbeans.org/jet-main/rev/02fdca0c279b
Comment 5 MackSix 2013-09-10 04:12:43 UTC
Did this make it into nightly builds? It still does not work and I got this IndexOutOfBounds exception today [1]. Possible related?

[1] Issue 235727

Product Version: NetBeans IDE Dev (Build 201309070001)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b40
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 6 Svata Dedic 2013-09-10 06:21:44 UTC
Hm, since there's no builder note in the issue, I think it was not propagated yet to main/golden (daily build). Closing till then - sorry. 
The fix is present on tag release74 branch (http://hg.netbeans.org/releases/annotate/cca47c335195/editor.lib/src/org/netbeans/editor/BaseKit.java), so it should eventually made it to the release.

Just note - the fix only fixes character typing. As the function relies on on-screen coordinates (which may get out of sync during atomic lock), it could break elsewhere where an action actually replicates changes to many lines.

From discussion held around rect selection, the mechanism is probably going to change to character-based selection, which can be more reliable.
Comment 7 MackSix 2013-10-03 02:13:53 UTC
Sorry, this still behaves exactly as described in comment 3 still. 

At line 79 when I type characters, all is fine.

When extending rectangular selection to line 80 and typing characters, it jumps to the far left and gets messed up.


Product Version: NetBeans IDE 7.4 RC2 (Build 201309252201)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)

And

Product Version: NetBeans IDE Dev (Build 201310020002)
Updates: Updates available
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 8 Martin Balin 2016-07-07 07:26:20 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