diff options
author | fvogel <fvogelnew1@free.fr> | 2015-12-26 20:52:21 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-12-26 20:52:21 (GMT) |
commit | 7fba872bef36903476be033836a8394fd742a1c0 (patch) | |
tree | 55c638085f078ac4c8f49ae14404e2b35df10162 /generic/tkTextDisp.c | |
parent | 60480c3f5dfc5ab6e13b6e55a310e3b991879eac (diff) | |
download | tk-7fba872bef36903476be033836a8394fd742a1c0.zip tk-7fba872bef36903476be033836a8394fd742a1c0.tar.gz tk-7fba872bef36903476be033836a8394fd742a1c0.tar.bz2 |
[.text sync -command $cmd] schedules execution of $cmd by the event loop at idle time
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r-- | generic/tkTextDisp.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index ba584ac..39311a6 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2958,18 +2958,18 @@ AsyncUpdateLineMetrics( * above). If there is a registered aftersync command, run that first. */ - if (textPtr->afterSyncCmd != NULL) { - int code; - Tcl_Preserve((ClientData)textPtr->interp); - code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); - if (code != TCL_OK && code != TCL_CONTINUE - && code != TCL_BREAK) { - Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); - Tcl_BackgroundError(textPtr->interp); + if (textPtr->afterSyncCmd) { + int code; + Tcl_Preserve((ClientData) textPtr->interp); + code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, + TCL_EVAL_GLOBAL); + if (code == TCL_ERROR) { + Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); + Tcl_BackgroundError(textPtr->interp); } - Tcl_Release((ClientData)textPtr->interp); - Tcl_DecrRefCount(textPtr->afterSyncCmd); - textPtr->afterSyncCmd = 0; + Tcl_Release((ClientData) textPtr->interp); + Tcl_DecrRefCount(textPtr->afterSyncCmd); + textPtr->afterSyncCmd = NULL; } /* |