summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2014-12-21 20:54:05 (GMT)
committerfvogel <fvogelnew1@free.fr>2014-12-21 20:54:05 (GMT)
commit9acc2ec22a702fc2ececac284fccf4a7698801b2 (patch)
treebe582dae9debad6d7b761bc84aa46a364220b953
parent8d9d01b8902bb7dba4a5d7fed731cdc3c096b2cc (diff)
downloadtk-9acc2ec22a702fc2ececac284fccf4a7698801b2.zip
tk-9acc2ec22a702fc2ececac284fccf4a7698801b2.tar.gz
tk-9acc2ec22a702fc2ececac284fccf4a7698801b2.tar.bz2
Fixed test of index being at start of both a logical line and a display line in TkTextFindDisplayLineEnd
-rw-r--r--generic/tkTextDisp.c4
-rw-r--r--tests/textDisp.test4
2 files changed, 6 insertions, 2 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index e318338..9d6a307 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -3383,8 +3383,10 @@ TkTextFindDisplayLineEnd(
* of the original index within its display
* line. */
{
+ TkTextIndex indexPtr2;
+ TkTextIndexBackBytes(textPtr, indexPtr, 1, &indexPtr2);
if (!end && indexPtr->byteIndex == 0
- && !TkTextIsElided(textPtr, indexPtr, NULL)) {
+ && !TkTextIsElided(textPtr, &indexPtr2, NULL)) {
/*
* Nothing to do.
*/
diff --git a/tests/textDisp.test b/tests/textDisp.test
index ea2100c..cab0ff6 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -2089,7 +2089,9 @@ test textDisp-16.41 {text count -xpixels with indices in elided lines} {
[.t count -xpixels 15.0 20.15] \
[.t count -xpixels 20.15 20.16] \
[.t count -xpixels 20.16 20.15]
-} [list 0 0 0 0 0 0 0 0 $fixedWidth -$fixedWidth]
+ .t tag remove hidden 20.0 20.15
+ lappend res [expr {[.t count -xpixels 5.0 20.0] != 0}]
+} [list 0 0 0 0 0 0 0 0 $fixedWidth -$fixedWidth 1]
test textDisp-16.42 {TkTextYviewCmd procedure with indices in elided lines} {
.t configure -wrap none
.t delete 1.0 end