summaryrefslogtreecommitdiffstats
path: root/generic/tkTextIndex.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-06-22 08:21:51 (GMT)
committerhobbs <hobbs>2002-06-22 08:21:51 (GMT)
commitb6d96bd6a4e4dc5169639b2d2c25c00cbcd629c3 (patch)
tree4b33174fd58b3eb7cbb1d1a584b23d10ac9388a4 /generic/tkTextIndex.c
parentcfa0529ef3bf8c4d9c87387908d3a32457499c51 (diff)
downloadtk-b6d96bd6a4e4dc5169639b2d2c25c00cbcd629c3.zip
tk-b6d96bd6a4e4dc5169639b2d2c25c00cbcd629c3.tar.gz
tk-b6d96bd6a4e4dc5169639b2d2c25c00cbcd629c3.tar.bz2
* doc/text.n: TIP #93 implementation that
* generic/tkText.c (TextWidgetCmd): enhances the text get and * generic/tkTextIndex.c (TkTextGetIndex): delete methods to accept * tests/text.test: multiple range pairs. This handles the delete case in an atomic, fixed-index fashion.
Diffstat (limited to 'generic/tkTextIndex.c')
-rw-r--r--generic/tkTextIndex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index 1ee3b05..b130d32 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextIndex.c,v 1.4 2002/01/17 03:35:00 dgp Exp $
+ * RCS: @(#) $Id: tkTextIndex.c,v 1.5 2002/06/22 08:21:51 hobbs Exp $
*/
#include "default.h"
@@ -377,6 +377,7 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
&last);
TkBTreeStartSearch(&first, &last, tagPtr, &search);
if (!TkBTreeCharTagged(&first, tagPtr) && !TkBTreeNextTag(&search)) {
+ Tcl_ResetResult(interp);
Tcl_AppendResult(interp,
"text doesn't contain any characters tagged with \"",
Tcl_GetHashKey(&textPtr->tagTable, hPtr), "\"",
@@ -527,6 +528,7 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
return TCL_OK;
error:
+ Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad text index \"", string, "\"",
(char *) NULL);
return TCL_ERROR;