From e4a2a61cac3dab0f9c33e4100e6888cdb12ff5da Mon Sep 17 00:00:00 2001 From: "fvogelnew1@free.fr" Date: Sat, 22 Nov 2014 22:05:23 +0000 Subject: Fixed bug [7703f947aa] - Wrong refresh of display lines when tagging text as elided --- generic/tkTextDisp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index f16c45b..d610d85 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -6429,6 +6429,7 @@ FindDLine( CONST TkTextIndex *indexPtr)/* Index of desired character. */ { TkTextLine *linePtr; + DLine *dlPtrPrev; if (dlPtr == NULL) { return NULL; @@ -6449,6 +6450,7 @@ FindDLine( linePtr = dlPtr->index.linePtr; while (linePtr != indexPtr->linePtr) { while (dlPtr->index.linePtr == linePtr) { + dlPtrPrev = dlPtr; dlPtr = dlPtr->nextPtr; if (dlPtr == NULL) { return NULL; @@ -6466,7 +6468,7 @@ FindDLine( } } if (indexPtr->linePtr != dlPtr->index.linePtr) { - return dlPtr; + return dlPtrPrev; } /* -- cgit v0.12 From 63615f29e681decaf9729ea938a2c5896a45f1a2 Mon Sep 17 00:00:00 2001 From: "fvogelnew1@free.fr" Date: Sat, 22 Nov 2014 22:14:37 +0000 Subject: Fixed textDisp-9.3 to -9.6 - The expected test results were not relevant without the update between tag add and tag remove --- tests/textDisp.test | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index 70c7208..ef65956 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1173,40 +1173,44 @@ test textDisp-9.3 {TkTextRedrawTag} { .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" update .t tag add big 2.2 2.4 + update .t tag remove big 1.0 end update list $tk_textRelayout $tk_textRedraw -} {2.0 2.0} +} {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.4 {TkTextRedrawTag} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" update .t tag add big 2.2 2.20 + update .t tag remove big 1.0 end update list $tk_textRelayout $tk_textRedraw -} {2.0 2.0} +} {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.5 {TkTextRedrawTag} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" update .t tag add big 2.2 2.end + update .t tag remove big 1.0 end update list $tk_textRelayout $tk_textRedraw -} {{2.0 2.20} {2.0 2.20}} +} {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.6 {TkTextRedrawTag} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" update .t tag add big 2.2 3.5 + update .t tag remove big 1.0 end update list $tk_textRelayout $tk_textRedraw -} {{2.0 2.20 3.0} {2.0 2.20 3.0}} +} {{2.0 2.20 3.0 3.20} {2.0 2.20 3.0 3.20 4.0 eof}} test textDisp-9.7 {TkTextRedrawTag} { .t configure -wrap char .t delete 1.0 end -- cgit v0.12 From a8acce41e02cb6c81209f9f58e8f6ae284096972 Mon Sep 17 00:00:00 2001 From: "fvogelnew1@free.fr" Date: Sat, 22 Nov 2014 22:23:41 +0000 Subject: Added test for bug [7703f947aa] - Wrong refresh of display lines when tagging text as elided --- tests/textDisp.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/textDisp.test b/tests/textDisp.test index ef65956..96670ac 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1262,6 +1262,19 @@ test textDisp-9.11 {TkTextRedrawTag} { update set tk_textRedraw } {} +test textDisp-9.12 {TkTextRedrawTag} { + .t configure -wrap char + .t delete 1.0 end + for {set i 1} {$i < 5} {incr i} { + .t insert end "Line $i+++Line $i\n" + } + .t tag configure hidden -elide true + .t tag add hidden 2.6 3.6 + update + .t tag add hidden 3.11 4.6 + update + list $tk_textRelayout $tk_textRedraw +} {2.0 {2.0 eof}} test textDisp-10.1 {TkTextRelayoutWindow} { .t configure -wrap char -- cgit v0.12