Tk Source Code

Check-in [644e9ee4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor corrections in comments.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA1: 644e9ee4c8143fc2183f4c05657538a457e663d6
User & Date: gcramer 2017-04-26 09:59:55
Context
2017-04-26
10:31
Fix in handling options -start/endline. check-in: af2458bb user: gcramer tags: revised_text, tip-466
09:59
Minor corrections in comments. check-in: 644e9ee4 user: gcramer tags: revised_text, tip-466
09:04
Changed expected results for textDisp-4.9. Actually deletion at end of text is now different in the revised version of the text widget. This is explained at http://scidb.sourceforge.net/tk/delete-index-range.html and more highlight is available in function TkTextGetUndeletableNewline() in tkText.c. Strictly speaking this is an incompatibility with the legacy text widget, but it's intended for the better. check-in: 031f51c7 user: fvogel tags: revised_text, tip-466
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/text.tcl.

1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040

proc ::tk::TextScrollPages {w count} {
    if {$count > 0} {
	if {[llength [$w dlineinfo end-1c]]} {
	    # Last display line of very last line is visible.
	    if {[llength [set res [$w dlineinfo -extents @first,last]]]} {
		if {[lindex $res 3] == 0} {
		    # Line is fully visible (vertically), no dothing to do.
		    return insert
		}
		# Line is only partially visible, so jump to this line.
		return [$w index "insert +[$w count -displaylines insert end-1c] displayline"]
	    }
	}
    } else {







|







1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040

proc ::tk::TextScrollPages {w count} {
    if {$count > 0} {
	if {[llength [$w dlineinfo end-1c]]} {
	    # Last display line of very last line is visible.
	    if {[llength [set res [$w dlineinfo -extents @first,last]]]} {
		if {[lindex $res 3] == 0} {
		    # Line is fully visible (vertically), so nothing to do.
		    return insert
		}
		# Line is only partially visible, so jump to this line.
		return [$w index "insert +[$w count -displaylines insert end-1c] displayline"]
	    }
	}
    } else {
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412

    for {set i 0} {$i < $n} {incr i} {
	set range [lindex $ranges $i]
	lassign $range s1 e1
	lassign [split $s1 .] sline1 scol1
	lassign [split $e1 .] eline1 ecol1

	# [$w compare "$e+1i" < $s1]
	if {$eline < $sline1 || ($eline == $sline1 && $ecol + 1 < $scol1)} {
	    lappend newRangeList [list $s $e]
	    lappend newRangeList {*}[lrange $ranges $i end]
	    set ranges $newRangeList
	    return $newRangeList
	}
	# [$w compare $s <= "$e1+1i"]
	if {$sline < $eline1 || ($sline == $eline1 && $scol <= $ecol1 + 1)} {
	    # [$w compare $s > $s1]
	    if {$sline > $sline1 || ($sline == $sline1 && $scol > $scol1)} {
		set s $s1; set sline $sline1; set scol $scol1
	    }
	    # [$w compare $e < $e1]
	    if {$eline < $eline1 || ($eline == $eline1 && $ecol < $ecol1)} {
		set e $e1; set eline $eline1; set ecol $ecol1
	    }
	} else {
	    lappend newRangeList $range
	}
    }







|






|





|







1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412

    for {set i 0} {$i < $n} {incr i} {
	set range [lindex $ranges $i]
	lassign $range s1 e1
	lassign [split $s1 .] sline1 scol1
	lassign [split $e1 .] eline1 ecol1

	# compare "$e+1i" < $s1
	if {$eline < $sline1 || ($eline == $sline1 && $ecol + 1 < $scol1)} {
	    lappend newRangeList [list $s $e]
	    lappend newRangeList {*}[lrange $ranges $i end]
	    set ranges $newRangeList
	    return $newRangeList
	}
	# compare $s <= "$e1+1i"
	if {$sline < $eline1 || ($sline == $eline1 && $scol <= $ecol1 + 1)} {
	    # [$w compare $s > $s1]
	    if {$sline > $sline1 || ($sline == $sline1 && $scol > $scol1)} {
		set s $s1; set sline $sline1; set scol $scol1
	    }
	    # compare $e < $e1
	    if {$eline < $eline1 || ($eline == $eline1 && $ecol < $ecol1)} {
		set e $e1; set eline $eline1; set ecol $ecol1
	    }
	} else {
	    lappend newRangeList $range
	}
    }