diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-02 15:08:27 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-02 15:08:27 (GMT) |
commit | db1813195a62a66315c34ba2b4a341f3efb331a9 (patch) | |
tree | 60d2477ada09b28f45c1e8594004153451f10785 /generic/tkTextIndex.c | |
parent | 309c748ad6d849d9cdb327bed24cff7e04f7ebd0 (diff) | |
download | tk-db1813195a62a66315c34ba2b4a341f3efb331a9.zip tk-db1813195a62a66315c34ba2b4a341f3efb331a9.tar.gz tk-db1813195a62a66315c34ba2b4a341f3efb331a9.tar.bz2 |
TIP #613 demo: rewrite "place" and text tag handling (-elide, -overstrike, -underline) using the new functionality
Diffstat (limited to 'generic/tkTextIndex.c')
-rw-r--r-- | generic/tkTextIndex.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index f55b884..82a1392 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -1607,7 +1607,7 @@ TkTextIndexForwChars( * toggled off), or it's a new tag with higher priority. */ - if (tagPtr->elideString != NULL) { + if (tagPtr->elide >= 0) { infoPtr->tagCnts[tagPtr->priority]++; if (infoPtr->tagCnts[tagPtr->priority] & 1) { infoPtr->tagPtrs[tagPtr->priority] = tagPtr; @@ -1635,12 +1635,12 @@ TkTextIndexForwChars( if (infoPtr->tagCnts[infoPtr->elidePriority] & 1) { elide = infoPtr->tagPtrs - [infoPtr->elidePriority]->elide; + [infoPtr->elidePriority]->elide > 0; break; } } } else { - elide = tagPtr->elide; + elide = tagPtr->elide > 0; infoPtr->elidePriority = tagPtr->priority; } } @@ -1857,7 +1857,7 @@ TkTextIndexCount( * toggled off), or it's a new tag with higher priority. */ - if (tagPtr->elideString != NULL) { + if (tagPtr->elide >= 0) { infoPtr->tagCnts[tagPtr->priority]++; if (infoPtr->tagCnts[tagPtr->priority] & 1) { infoPtr->tagPtrs[tagPtr->priority] = tagPtr; @@ -1885,12 +1885,12 @@ TkTextIndexCount( if (infoPtr->tagCnts[ infoPtr->elidePriority] & 1) { elide = infoPtr->tagPtrs[ - infoPtr->elidePriority]->elide; + infoPtr->elidePriority]->elide > 0; break; } } } else { - elide = tagPtr->elide; + elide = tagPtr->elide > 0; infoPtr->elidePriority = tagPtr->priority; } } @@ -2146,7 +2146,7 @@ TkTextIndexBackChars( * it's a new tag with higher priority. */ - if (tagPtr->elideString != NULL) { + if (tagPtr->elide >= 0) { infoPtr->tagCnts[tagPtr->priority]++; if (infoPtr->tagCnts[tagPtr->priority] & 1) { infoPtr->tagPtrs[tagPtr->priority] = tagPtr; @@ -2172,12 +2172,12 @@ TkTextIndexBackChars( while (--infoPtr->elidePriority > 0) { if (infoPtr->tagCnts[infoPtr->elidePriority] & 1) { elide = infoPtr->tagPtrs[ - infoPtr->elidePriority]->elide; + infoPtr->elidePriority]->elide > 0; break; } } } else { - elide = tagPtr->elide; + elide = tagPtr->elide > 0; infoPtr->elidePriority = tagPtr->priority; } } |