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 198957 - Horizontal scrollbar does not appear when typing beyond window's end
Summary: Horizontal scrollbar does not appear when typing beyond window's end
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.1
Hardware: PC Linux
: P1 normal with 3 votes (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 110160 202473 202476 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-27 13:57 UTC by Jesse Glick
Modified: 2011-11-01 14:02 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
An "action shot" of the editor pane in the middle of a repaint (64.06 KB, image/png)
2011-05-27 13:57 UTC, Jesse Glick
Details
Making two lines longer stops flickering (64.61 KB, image/png)
2011-05-27 13:58 UTC, Jesse Glick
Details
After turning wrap off then back on; flickering resumes if file reopened, or certain edits made (60.30 KB, image/png)
2011-05-27 14:02 UTC, Jesse Glick
Details
IDE window in one state (126.43 KB, image/png)
2011-08-26 12:26 UTC, Jesse Glick
Details
IDE window in another state (105.35 KB, image/png)
2011-08-26 12:27 UTC, Jesse Glick
Details
Repro scenario for flickering scrollbars (146.60 KB, image/png)
2011-09-16 18:25 UTC, torsten_paul
Details
Missing horizontal Scrollbar (78.80 KB, image/png)
2011-09-21 18:08 UTC, torsten_paul
Details
no_scroll (3.94 MB, video/quicktime)
2011-09-22 05:47 UTC, michal.owsiak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-05-27 13:57:27 UTC
Created attachment 108552 [details]
An "action shot" of the editor pane in the middle of a repaint

Happening consistently in my standard userdir but not sure exactly how to reproduce in another userdir since it seems to be dependent on the exact window layout and font sizing; occurs at least since 20110525-6c97b2ff5e32, using JDK 6 or 7. I have line wrapping on, at word boundaries though the same problem occurs when wrapping at any boundary; does not occur when line wrapping is off.

When I open a particular *.properties file with a few long lines (enough to exceed screen width), the editor display goes into an endless loop (100% CPU), alternately showing and hiding a vertical scrollbar. (I have no idea why there is ever a vertical scrollbar since the number of lines in the file is only around 2/3 the vertical size of the editor pane.) The presence of the scrollbar makes the displayable lines a bit shorter, causing the line to start to wrap, causing the scrollbar to disappear, etc. The effect is that all lines in the document below the long line flash very quickly (many times per second). If I make the upper long line a bit shorter or longer (e.g. type '#' at the start), I can disable the flashing on that line and the lines between it and the lower long line, but flashing continues on the lower long line and the lines beneath it to the end.

Oddly, if with the file open I turn off line wrapping (making the problem stop as expected), then turn line wrapping back on, the flashing stops - though a horizontal scroll bar appears and one of the long lines is not wrapped (others are). But if I then close and reopen the file the problem reappears.
Comment 1 Jesse Glick 2011-05-27 13:58:11 UTC
Created attachment 108553 [details]
Making two lines longer stops flickering
Comment 2 Jesse Glick 2011-05-27 14:02:11 UTC
Created attachment 108554 [details]
After turning wrap off then back on; flickering resumes if file reopened, or certain edits made
Comment 3 Miloslav Metelka 2011-05-31 21:03:40 UTC
The extra virtual vertical space was added in the past due to users' requests (actually it was added then removed then re-added :-) It's in editor.lib2/.../DocumentView.getPreferredSpan(). I could possibly change the algorithm to not add anything if the real span fits a single page.
Anyway I understand the problem with the flickering and I'm searching for an appropriate fix.
Comment 4 Jesse Glick 2011-08-26 12:21:56 UTC
Still happening to me on occasion in random source files, by the way - sometimes even when the entire content of the document fits in the visible scroll area (both horizontally and vertically).
Comment 5 Jesse Glick 2011-08-26 12:26:35 UTC
Created attachment 110241 [details]
IDE window in one state

Here the import block is expanded (I normally keep it collapsed). No flickering, though it is wrong that scrollbars is visible, since the content easily fits onscreen.

(Formerly lines 71-72 were one long line; I inserted a line break but this did not affect behavior immediately. After closing and reopening the file the flickering goes away even in state #2, though the vertical scrollbar remains; the horizontal scrollbar disappears.)
Comment 6 Jesse Glick 2011-08-26 12:27:37 UTC
Created attachment 110242 [details]
IDE window in another state

With the import block collapsed, the H and V scrollbars both flicker. You can see the V bar in the process is being redrawn.
Comment 7 torsten_paul 2011-09-16 18:25:51 UTC
Created attachment 110826 [details]
Repro scenario for flickering scrollbars

I can reproduce the flickering scrollbars with the following steps:

1) Create a new empty file and open in editor (top-most screenshot)

2) Just press enter to produce for example 16 empty lines

3) Resize the netbeans window to just make the vertical scrollbar appear (middle screenshot)

4) Start entering something on the last line, slowly before reaching the end of the screen

5) As soon as the entered text hits the vertical scrollbar, the horizontal scrollbar appears too, and both start flickering wildly (bottom screenshot)

This is with with

Product Version: NetBeans IDE Dev (Build 201109100600)
Java: 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02
System: Linux version 3.0.0-1-686-pae running on i386; UTF-8; en_US (nb)
User directory: /home/tp/.netbeans/dev
Cache directory: /home/tp/.netbeans/dev/var/cache

and also with the latest version

Product Version: NetBeans IDE Dev (Build 201109141017)
Java: 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02
System: Linux version 3.0.0-1-686-pae running on i386; UTF-8; en_US (nb)
User directory: /home/tp/.netbeans/dev
Cache directory: /home/tp/.netbeans/dev/var/cache
Comment 8 Selpi 2011-09-19 06:12:29 UTC
Can't reproduce bug with build 201109180600
Comment 9 torsten_paul 2011-09-19 10:04:07 UTC
I still can reproduce this with the latest build:

Product Version: NetBeans IDE Dev (Build 201109180600)
Java: 1.6.0_27; Java HotSpot(TM) 64-Bit Server VM 20.2-b06
System: Linux version 2.6.18-194.11.1.el5 running on amd64; UTF-8; en_US (nb)

Maybe this is related to the Java Version / Look&Feel? I'll try some combinations later..
Comment 10 torsten_paul 2011-09-19 10:25:36 UTC
Also reproduceable with following combinations:

Product Version: NetBeans IDE Dev (Build 201109180600)
Java: 1.6.0_27; Java HotSpot(TM) 64-Bit Server VM 20.2-b06
=> Look&Feel set to Nimbus

and

Product Version: NetBeans IDE Dev (Build 201109180600)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
=> Default Look&Feel (= GTK as this is on Linux)
Comment 11 Miloslav Metelka 2011-09-21 17:04:37 UTC
I can't reproduce either making steps from #7. Is it still relevant?
Comment 12 torsten_paul 2011-09-21 18:08:06 UTC
Created attachment 110986 [details]
Missing horizontal Scrollbar

I've checked with the latest build:

Product Version: NetBeans IDE Dev (Build 201109202329)
Java: 1.7.0_147-icedtea; OpenJDK Client VM 21.0-b17
System: Linux version 3.0.0-1-686-pae running on i386; UTF-8; en_US (nb)

The flickering is gone, but instead the horizontal scrollbar remains missing, even with really long text line (See column indicator in the screenshot, I'm typing at column 540, which is way out of visible screen space).

After resizing the NetBeans window the horizontal scrollbar appears.
Comment 13 michal.owsiak 2011-09-22 05:47:47 UTC
Created attachment 111002 [details]
no_scroll

Steps to reproduce use case with missing horizontal scroll.
Comment 14 Marian Mirilovic 2011-09-22 06:47:00 UTC
Problem with hiding scrollbar sounds like regression ...
Comment 15 Miloslav Metelka 2011-09-22 08:30:09 UTC
Reproduced. I've updated bug's title to reflect the current state.
Horizontal scrollbar fixed:
http://hg.netbeans.org/jet-main/rev/2934660e7de0

Once Jirka verifies I'll transplant into release71_beta.
Thanks.
Comment 16 Marian Mirilovic 2011-09-22 08:57:53 UTC
Ok, make it stopper for Beta - thanks !
Comment 17 Jiri Prox 2011-09-22 10:08:05 UTC
verified in trunk, please transplant to beta
thanks
Comment 18 Milutin Kristofic 2011-09-22 11:37:49 UTC
*** Bug 202473 has been marked as a duplicate of this bug. ***
Comment 19 Miloslav Metelka 2011-09-22 12:25:26 UTC
Integrated in release71_beta:
2934660e7de0 transplanted to c96647adfc8a
Comment 20 Jiri Prox 2011-09-23 12:05:55 UTC
verified in beta
Comment 21 Quality Engineering 2011-09-23 13:24:48 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/2934660e7de0
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #198957 - Horizontal scrollbar does not appear when typing beyond window's end.
Comment 22 Miloslav Metelka 2011-09-26 09:29:27 UTC
*** Bug 202476 has been marked as a duplicate of this bug. ***
Comment 23 Jesse Glick 2011-10-20 16:13:51 UTC
I am not sure what exactly you fixed, but the bug I initially reported happened to me again in 20111019-8087a69bb336. Editing a POM with a long initial line (xsi:schemaLocation etc.), all well until I insert a blank line at the top of the file, then the usual flickering.
Comment 24 Miloslav Metelka 2011-10-26 12:58:12 UTC
So the horizontal scrollbar appears correctly but the scrollbars flicker, right?
I was able to reproduce the flickering. It is due to the extra vertical space added when text component size exceeds the visible area (vert.scrollbar becomes visible). When running with -J-Dorg.netbeans.editor.disable.end.virtual.space=true I can't reproduce the problem.
 I will change the method of computation of the extra size.
Comment 25 Miloslav Metelka 2011-10-26 14:51:48 UTC
http://hg.netbeans.org/jet-main/rev/fbb1a1c3b128
Comment 26 Quality Engineering 2011-10-27 14:07:30 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/fbb1a1c3b128
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #198957 - Horizontal scrollbar does not appear when typing beyond window's end - fixed flickering of scrollbars.
Comment 27 Miloslav Metelka 2011-11-01 14:02:27 UTC
*** Bug 110160 has been marked as a duplicate of this bug. ***