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 130014 - Line numbers gutter width is not resized after line removal
Summary: Line numbers gutter width is not resized after line removal
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Max Sauer
URL:
Keywords: SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2008-03-13 10:55 UTC by jsvec
Modified: 2008-03-18 12:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Fix for this bug - changed when should be the GlyphGutter resized (814 bytes, patch)
2008-03-14 01:33 UTC, jsvec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jsvec 2008-03-13 10:55:43 UTC
GlyphGutter is resized only if there are added new lines to the file. This causes that if there is one line in the
editor after adding and removing again another 100 lines of text the gutter stays wide.
Comment 1 jsvec 2008-03-14 01:33:34 UTC
Created attachment 58365 [details]
Fix for this bug - changed when should be the GlyphGutter resized
Comment 2 Vitezslav Stejskal 2008-03-14 09:07:29 UTC
Thanks for the patch, but this actually may have been intentional to prevent repeated resizing when for example adding
and deleting lines around the line 100. Whoever is going to apply the patch please make sure that there are no strange
side effects. I personally think that it is perfectly ok for the gutter to stay wide.
Comment 3 jsvec 2008-03-15 00:08:45 UTC
Maybe this was intentional but I doubt it has any rational background - or at least has now in 6.x with JRE 1.5/1.6 -
because the resize and following repaint is really fast. I tried to experiment with editor window full of characters so
after resize also bottom scrollbar appeared and everything was immediately redrawn. To rationalize why is IMHO not OK to
leave the gutter wide - if you have big monitor it probably does not bother you but people with smaller resolutions are
hunting pixels of free space.
Resize is in the most common case done only when adding or removing the 10th, 100th, 1000th,... line. I do not think you
will be adding and removing lines around that bounds to often, you either add new lines (writing new code) or remove
lines (refactoring, simplifying).
Comment 4 Vitezslav Stejskal 2008-03-15 17:11:52 UTC
Fair enough, what you are saying makes sense.
Comment 5 jsvec 2008-03-15 19:43:45 UTC
I also checked behaviour of other IDEs. Eclipse has minimum size of two chars but if the number is larger than 99 then
it resizes the gutter. Idea resizes always but what is interesting not when adding lines 9->10 or 99->100 but 7->8,
97->98 (probably a bug)
Comment 6 Vitezslav Stejskal 2008-03-18 12:32:31 UTC
Patch applied, thanks. http://hg.netbeans.org/main/rev/a4cca3cdbaf5