diff options
author | fvogelnew1@free.fr <fvogel> | 2012-05-17 14:30:38 (GMT) |
---|---|---|
committer | fvogelnew1@free.fr <fvogel> | 2012-05-17 14:30:38 (GMT) |
commit | 45371a3f567bc0e55477b669fcea4a7662f051c1 (patch) | |
tree | 7bc1ad7d29414f00126f3f2adeadc7cc81183a81 | |
parent | ff7d277e8ca7be6a00fe05b46f7750666088a0c8 (diff) | |
download | tk-45371a3f567bc0e55477b669fcea4a7662f051c1.zip tk-45371a3f567bc0e55477b669fcea4a7662f051c1.tar.gz tk-45371a3f567bc0e55477b669fcea4a7662f051c1.tar.bz2 |
[Bug 1630254]: missing scrolling of text widget when from a -startline == -endline initial state it is configured to display a non-empty part of it
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tkTextDisp.c | 17 |
2 files changed, 21 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2012-05-?? Francois Vogel <fvogelnew1@free.fr> + + * generic/tkTextDisp.c: [Bug 1630254]: missing scrolling of text widget + when from a -startline == -endline initial state it is configured to display + a non-empty part of it + 2012-05-09 Jan Nijtmans <nijtmans@users.sf.net> * win/tkWinWm.c: Change TkpWmSetState signature to match UNIX, diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d0cd4d2..13695e8 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2005,8 +2005,21 @@ UpdateDisplayInfo( * widget. */ - lineNum = -1; - bytesToCount = 0; /* Stop compiler warning. */ + if (textPtr->start == textPtr->end) { + /* + * Empty peer widget. + */ + lineNum = -1; + bytesToCount = 0; /* Stop compiler warning. */ + } else { + /* + * Widget that was empty, but no longer is. + * (Bug 1630254) + */ + lineNum = TkBTreeNumLines(textPtr->sharedTextPtr->tree, + textPtr) - 1; + bytesToCount = INT_MAX; + } } else { lineNum = TkBTreeLinesTo(textPtr, dInfoPtr->dLinePtr->index.linePtr); |