diff options
author | fvogelnew1@free.fr <fvogel> | 2014-12-23 10:59:48 (GMT) |
---|---|---|
committer | fvogelnew1@free.fr <fvogel> | 2014-12-23 10:59:48 (GMT) |
commit | c0b3ca7a619c1a0cdf819664e7b250c53404e799 (patch) | |
tree | e34c21dd07b8128f89ac3963d06fb45162eb71c6 | |
parent | f7374e4f5e190d1b8c0e684cd7140d5690700b4c (diff) | |
download | tk-c0b3ca7a619c1a0cdf819664e7b250c53404e799.zip tk-c0b3ca7a619c1a0cdf819664e7b250c53404e799.tar.gz tk-c0b3ca7a619c1a0cdf819664e7b250c53404e799.tar.bz2 |
Fixed wrong index returned by @x,y with elided lines at end of text - Bug [c199ef90a6]
-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 f16c45b..bb026af 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -6649,10 +6649,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 70c7208..ae294c6 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -2444,7 +2444,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"] \ |