summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-01-25 13:55:34 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-01-25 13:55:34 (GMT)
commit66c7b91f6e33f0c67be2daa3ead0ee6526981f26 (patch)
tree20ca3c2c18188d736fec1c60cf89eb085c75efce /tests
parent936e38c7360b67f7e3f2a1d4c7066842e0082737 (diff)
downloadtk-66c7b91f6e33f0c67be2daa3ead0ee6526981f26.zip
tk-66c7b91f6e33f0c67be2daa3ead0ee6526981f26.tar.gz
tk-66c7b91f6e33f0c67be2daa3ead0ee6526981f26.tar.bz2
Fixed disappearing cursor when moving up one line at the boundary of elided lines. Factorized the code again in the process, using function IsStartOfNotMergedLine when possible.
Diffstat (limited to 'tests')
-rw-r--r--tests/textDisp.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 44a45b2..12a20c6 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -1152,6 +1152,41 @@ test textDisp-8.11 {TkTextChanged, scrollbar notification when changes are off-s
.t configure -yscrollcommand ""
set scrollInfo
} {0.0 0.625}
+test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past and new lines} {
+ .t delete 1.0 end
+ .t configure -wrap none
+ for {set i 1} {$i < 25} {incr i} {
+ .t insert end "Line $i Line $i\n"
+ }
+ .t tag add hidden 5.0 8.0
+ .t tag configure hidden -elide true
+ .t mark set insert 9.0
+ update
+ .t mark set insert 8.0 ; # up one line
+ update
+ set res [list $tk_textRedraw]
+ .t mark set insert 12.2 ; # in the visible text
+ update
+ lappend res $tk_textRedraw
+ .t mark set insert 6.5 ; # in the hidden text
+ update
+ lappend res $tk_textRedraw
+ .t mark set insert 3.5 ; # in the visible text again
+ update
+ lappend res $tk_textRedraw
+ .t mark set insert 3.8 ; # within the same line
+ update
+ lappend res $tk_textRedraw
+ # This last one is tricky: correct result really is {2.0 3.0} when
+ # calling .t mark set insert, two calls to TkTextChanged are done:
+ # (a) to redraw the line of the past position of the cursor
+ # (b) to redraw the line of the new position of the cursor
+ # During (a) the display line showing the cursor gets unlinked,
+ # which leads TkTextChanged in (b) to schedule a redraw starting
+ # one line _before_ the line containing the insert cursor. This is
+ # because during (b) findDLine cannot return the display line the
+ # cursor is in since this display line was just unlinked in (a).
+} {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {2.0 3.0}}
test textDisp-9.1 {TkTextRedrawTag} {
.t configure -wrap char