summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-17 05:33:25 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-17 05:33:25 (GMT)
commit7657ba2c549606f98734f4172266dc110fbecaa5 (patch)
treea0ca8b1bb15b6c9b5679b3caacb09ab71aca25df /generic
parentb2c383f4b4e1df4ee9393ca65a9ba551753739a7 (diff)
downloadtk-7657ba2c549606f98734f4172266dc110fbecaa5.zip
tk-7657ba2c549606f98734f4172266dc110fbecaa5.tar.gz
tk-7657ba2c549606f98734f4172266dc110fbecaa5.tar.bz2
bug-3021557 Moving the cursor in elided text freezes Tkbug_3021557
Diffstat (limited to 'generic')
-rw-r--r--generic/tkText.c14
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;
}
}