Unnecessary window grow when opening file
Brought to you by:
tringali
The NEdit window unnecessary grow, when a file is opened with a linenumber width that is less or equal the current gutter width, after a first resize was necessary.
To reproduce:
CVS from 2007-01-05, and set MIN_LINE_NUM_COLS to 3 (just to force the problem with small files), with show line numbers option enabled.
open file with < 1000 lines (source/calltips.c)
=> window size doesn't changed
open file with >= 1000 lines (source/macro.c)
=> window size changed by 1, only the gutter (now 4)
open file with < 1000 lines (source/linkdate.c)
=> window size changed by 1, but the gutter is still 4 width
Logged In: YES
user_id=119143
Originator: NO
Possibly a follow-up to SF#1055649.
Logged In: YES
user_id=618141
Originator: NO
Sounds like [ 1588932 ] "line number not shown correctly" to me.
Logged In: YES
user_id=122956
Originator: YES
more examples, this time with "Move Tab to ...":
I)
1. open in a new fresh nedit window a file with >10000 lines (so the gutter does change)
2. open in a new fresh nedit window a file with <10000 lines (so the gutter don't change)
3. use the "move tab to..." menu command to move the <10000 lines file to the >10000 lines window
result: the line gutter for the <10000 lines file is still 4, not 5 as the line gutter for the >10000 lines tab
even after switching tabs the gutter don't change
II)
1. open in a new fresh nedit window a file with <10000 lines (so the gutter don't change)
2. open in a new fresh nedit window a file with >10000 lines (so the gutter does change)
3. use the "move tab to..." menu command to move the >10000 lines file to the <10000 lines window
result: the line gutter for the <10000 lines file is still 4, not 5 as the line gutter for the >10000 lines tab. but the window was not grown, so one column is missing from the >10000 lines tab
Logged In: YES
user_id=122956
Originator: YES
ok, my last comment doesn't really fit to this bug report, but it should be the same problem.
and ajbj, the line numbers are shown fine, only the automatic window/gutter wide setting is not correct or at least inconsistent.
Logged In: YES
user_id=122956
Originator: YES
Finally, I had time to fix this annoying issue by myself. The fix changes the
semantic slightly to the following:
The window not only grow when more line columns are needed but also shrinks if
fewer columns are needed.
I must admit that this new behavior isn't really wanted by me, but makes the fix
simple. But I think I can live with that.
File Added: fix_line_gutter_bugs.diff
Logged In: YES
user_id=122956
Originator: YES
Sorry there was a typo in the patch
File Added: fix_line_gutter_bugs.diff
disable resizing patch
Logged In: YES
user_id=122956
Originator: YES
This is a follow-up patch, which introduce an option to disable any window resizing originating from changes to the line gutter width.
optione name: nedit.resizeWindow
File Added: resize-opt.diff
possible fix for all bugs
Logged In: YES
user_id=122956
Originator: YES
one small update to the fix_line_gutter_bugs.diff patch: resize gutter after closing last window
File Added: fix_line_gutter_bugs.diff