diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-01-19 05:43:46 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-01-19 05:43:46 (GMT) |
commit | 2931e05764b25ec1ac949a503b9691b1b7391793 (patch) | |
tree | 648d9de77846c88ee5a8cf4b10dcb05107aac3a8 /generic | |
parent | b2c383f4b4e1df4ee9393ca65a9ba551753739a7 (diff) | |
parent | 7657ba2c549606f98734f4172266dc110fbecaa5 (diff) | |
download | tk-2931e05764b25ec1ac949a503b9691b1b7391793.zip tk-2931e05764b25ec1ac949a503b9691b1b7391793.tar.gz tk-2931e05764b25ec1ac949a503b9691b1b7391793.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; } } |