diff options
author | fvogel <fvogelnew1@free.fr> | 2014-12-23 11:09:50 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2014-12-23 11:09:50 (GMT) |
commit | 8410740338e3be5223b127941f7d9a4f89b5ce70 (patch) | |
tree | 2153979123ea474273e88b45cb5b8b84ef2f0154 | |
parent | 9acc2ec22a702fc2ececac284fccf4a7698801b2 (diff) | |
download | tk-8410740338e3be5223b127941f7d9a4f89b5ce70.zip tk-8410740338e3be5223b127941f7d9a4f89b5ce70.tar.gz tk-8410740338e3be5223b127941f7d9a4f89b5ce70.tar.bz2 |
Cherrypicked bug fix for Bug [c199ef90a6] - Wrong index returned by @x,y with elided lines at end of text
-rw-r--r-- | generic/tkTextDisp.c | 7 | ||||
-rw-r--r-- | tests/textDisp.test | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 9d6a307..14f843b 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -6754,10 +6754,15 @@ DlineIndexOfX( * We've reached the end of the text. */ + TkTextIndexBackChars(NULL, indexPtr, 1, indexPtr, COUNT_INDICES); return; } if (chunkPtr->nextPtr == NULL) { - TkTextIndexBackChars(NULL, indexPtr, 1, indexPtr, COUNT_INDICES); + /* + * We've reached the end of the display line. + */ + + TkTextIndexBackChars(NULL, indexPtr, 1, indexPtr, COUNT_INDICES); return; } chunkPtr = chunkPtr->nextPtr; diff --git a/tests/textDisp.test b/tests/textDisp.test index cab0ff6..6c21700 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -2558,7 +2558,7 @@ test textDisp-19.11.23 {TextWidgetCmd procedure, "index +displaylines"} { [.t index "12.0 +2d lines"] [.t index "11.0 +2d lines"] \ [.t index "13.0 +2d lines"] [.t index "13.0 +3d lines"] \ [.t index "13.0 +4d lines"] -} {16.17 16.33 16.28 16.46 16.28 16.49 16.65 17.0} +} {16.17 16.33 16.28 16.46 16.28 16.49 16.65 16.72} .t tag remove elide 1.0 end test textDisp-19.11.24 {TextWidgetCmd procedure, "index +/-displaylines"} { list [.t index "11.5 + -1 display lines"] \ |