summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c17
1 files changed, 15 insertions, 2 deletions
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);