summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index ff90520..d31d2f3 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -2942,9 +2942,20 @@ AsyncUpdateLineMetrics(
/*
* We have looped over all lines, so we're done. We must release our
* refCount on the widget (the timer token was already set to NULL
- * above).
+ * above). If there is a registered command, run that first.
*/
+ if (textPtr->linesUpdatedCmd != NULL) {
+ Tcl_Preserve((ClientData)textPtr->interp);
+ int code = Tcl_EvalObjEx(textPtr->interp, textPtr->linesUpdatedCmd, TCL_EVAL_GLOBAL);
+ if (code != TCL_OK && code != TCL_CONTINUE
+ && code != TCL_BREAK) {
+ Tcl_AddErrorInfo(textPtr->interp, "\n (text yupdate)");
+ Tcl_BackgroundError(textPtr->interp);
+ }
+ Tcl_Release((ClientData)textPtr->interp);
+ }
+
textPtr->refCount--;
if (textPtr->refCount == 0) {
ckfree((char *) textPtr);