diff options
author | vincentdarley <vincentdarley> | 2003-11-07 12:06:47 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2003-11-07 12:06:47 (GMT) |
commit | 72a88aa5cae0b9f4103d5cab3da7085f3f4ada3d (patch) | |
tree | 617942b27e4145ce929f01bbc318fd08728b8945 /generic | |
parent | 76c9825c10877956d64e567a67185cc2690c547d (diff) | |
download | tk-72a88aa5cae0b9f4103d5cab3da7085f3f4ada3d.zip tk-72a88aa5cae0b9f4103d5cab3da7085f3f4ada3d.tar.gz tk-72a88aa5cae0b9f4103d5cab3da7085f3f4ada3d.tar.bz2 |
another elide/tkchat/tkTextDisp.c fix
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkTextDisp.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 08680f9..ebe9b4c 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextDisp.c,v 1.22 2003/11/03 16:10:12 vincentdarley Exp $ + * RCS: @(#) $Id: tkTextDisp.c,v 1.23 2003/11/07 12:06:47 vincentdarley Exp $ */ #include "tkPort.h" @@ -955,6 +955,7 @@ LayoutDLine(textPtr, indexPtr) */ elide = TkTextIsElided(textPtr, indexPtr); /* save a malloc */ if (elide && indexPtr->byteIndex==0) { + int tagElidePriority = -1; maxBytes = 0; for (segPtr = indexPtr->linePtr->segPtr; segPtr != NULL; @@ -969,11 +970,25 @@ LayoutDLine(textPtr, indexPtr) break; } maxBytes += segPtr->size; + /* + * Reset tag elide priority, since we're on a new + * character. + */ + tagElidePriority = -1; } else if ((segPtr->typePtr == &tkTextToggleOffType) - || (segPtr->typePtr == &tkTextToggleOnType)) { - if (segPtr->body.toggle.tagPtr->elideString != NULL) { - elide = (segPtr->typePtr == &tkTextToggleOffType) - ^ segPtr->body.toggle.tagPtr->elide; + || (segPtr->typePtr == &tkTextToggleOnType)) { + TkTextTag *tagPtr = segPtr->body.toggle.tagPtr; + if (tagPtr->elideString != NULL) { + /* + * Only update the elide status if this tag has + * higher priority than any other we've so far + * seen at this index. + */ + if (tagPtr->priority > tagElidePriority) { + elide = ((segPtr->typePtr == &tkTextToggleOffType) + ^ tagPtr->elide); + tagElidePriority = tagPtr->priority; + } } } } |