summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2012-01-19 19:53:34 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2012-01-19 19:53:34 (GMT)
commit83fefd878a94b13d2842527b3854b961a66a2684 (patch)
treef89178fd23eb2c6e8820b0e4024519aa7d1d6093 /generic
parentc7251dad17fbae5b70851ff26474d45cbfb28698 (diff)
parent129869af8d3b8ad431ac46f1ba3c420ce28b90ea (diff)
downloadtk-83fefd878a94b13d2842527b3854b961a66a2684.zip
tk-83fefd878a94b13d2842527b3854b961a66a2684.tar.gz
tk-83fefd878a94b13d2842527b3854b961a66a2684.tar.bz2
[Bug-3021557]: Moving the cursor in elided text freezes Tk
FossilOrigin-Name: 34eab8bf009af77fe16af810152925e48d503272
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 360240c..448cab1 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -920,7 +920,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) {
@@ -929,17 +929,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;
}
}