diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-01-17 05:33:25 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-01-17 05:33:25 (GMT) |
commit | 0dcdb6e905be50ac2bc4728134739cad781a1ea8 (patch) | |
tree | a0ca8b1bb15b6c9b5679b3caacb09ab71aca25df /generic | |
parent | b5440b5836c841107c7ddafdc0e7411e9ad857b3 (diff) | |
download | tk-0dcdb6e905be50ac2bc4728134739cad781a1ea8.zip tk-0dcdb6e905be50ac2bc4728134739cad781a1ea8.tar.gz tk-0dcdb6e905be50ac2bc4728134739cad781a1ea8.tar.bz2 |
bug-3021557 Moving the cursor in elided text freezes Tk
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkText.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index 187be65..d4bc065 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -907,7 +907,7 @@ TextWidgetObjCmd( * We're going to count up all display lines in the logical * line of 'indexFromPtr' up to, but not including the logical * line of 'indexToPtr', and then subtract off what we didn't - * what from 'from' and add on what we didn't count from 'to. + * want from 'from' and add on what we didn't count from 'to. */ while (index.linePtr != indexToPtr->linePtr) { @@ -916,17 +916,9 @@ TextWidgetObjCmd( /* * We might have skipped past indexToPtr, if we have * multiple logical lines in a single display line. - * Therefore we iterate through each intermediate logical - * line, just to check. Another approach would be just to - * use TkTextIndexCmp on every while() iteration, but that - * would be less efficient. */ - - while (fromPtr != index.linePtr) { - fromPtr = TkBTreeNextLine(textPtr, fromPtr); - if (fromPtr == indexToPtr->linePtr) { - break; - } + if (TkTextIndexCmp(&index,indexToPtr) > 0) { + break; } } |