707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
|
@ }
@ }
@
@ foreach c {.lnA .lnB .mkr} {
@ $c config -width $gDiffs($idx,[colType $c]-width)
@ }
@
@ # Add whitespace to equalize line lengths.
@ regexp {\d+} [.txtA index {end -1c}] numLines
@ set width $gDiffs($idx,txt-width)
@ foreach c {.txtA .txtB} {
@ for {set ln 1} {$ln <= $numLines} {incr ln} {
@ regexp {\d+$} [$c index $ln.end] len
@ $c insert $ln.end [string repeat " " [expr {$width-$len}]] ws
@ }
@ }
@
@ foreach c [cols] {
@ $c config -state disabled
@ }
@ }
@
@ proc cycleDiffs {{inc 1}} {
@ global gIdx
|
<
<
<
<
<
<
<
<
<
<
|
707
708
709
710
711
712
713
714
715
716
717
718
719
720
|
@ }
@ }
@
@ foreach c {.lnA .lnB .mkr} {
@ $c config -width $gDiffs($idx,[colType $c]-width)
@ }
@
@ foreach c [cols] {
@ $c config -state disabled
@ }
@ }
@
@ proc cycleDiffs {{inc 1}} {
@ global gIdx
|
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
|
@ } else {
@ grid $sb
@ $sb set $first $last
@ }
@ }
@ }
@
@ proc copyText {c} {
@ set txt ""
@ # Copy selection without excess trailing whitespace
@ $c tag config ws -elide 1
@ catch {
@ $c tag add sel sel.first sel.last
@ set txt [selection get]
@ }
@ $c tag config ws -elide 0
@ clipboard clear
@ clipboard append $txt
@ }
@
@ wm withdraw .
@ wm title . $CFG(TITLE)
@ wm iconname . $CFG(TITLE)
@ bind . <q> exit
@ bind . <Tab> {cycleDiffs; break}
@ bind . <<PrevWindow>> {cycleDiffs -1; break}
@ bind . <Return> {
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|
731
732
733
734
735
736
737
738
739
740
741
742
743
744
|
@ } else {
@ grid $sb
@ $sb set $first $last
@ }
@ }
@ }
@
@ wm withdraw .
@ wm title . $CFG(TITLE)
@ wm iconname . $CFG(TITLE)
@ bind . <q> exit
@ bind . <Tab> {cycleDiffs; break}
@ bind . <<PrevWindow>> {cycleDiffs -1; break}
@ bind . <Return> {
|
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
|
@ set txt .txt$side
@ text $txt -width $CFG(WIDTH) -height $CFG(HEIGHT) -wrap none \
@ -xscroll {scrollSync x {.sbxA .sbxB}}
@ foreach tag {add rm chng} {
@ $txt tag config $tag -background $CFG([string toupper $tag]_BG)
@ $txt tag lower $tag
@ }
@ bind $txt <<Copy>> {copyText %W; break}
@ bind $txt <<Cut>> {copyText %W; break}
@ }
@ text .mkr
@
@ font create mono -family courier -size $CFG(FONT_SIZE)
@ foreach font $CFG(FONTS) {
@ if {[lsearch -exact [font families] $font] != -1} {
@ font config mono -family $font
|
<
<
|
776
777
778
779
780
781
782
783
784
785
786
787
788
789
|
@ set txt .txt$side
@ text $txt -width $CFG(WIDTH) -height $CFG(HEIGHT) -wrap none \
@ -xscroll {scrollSync x {.sbxA .sbxB}}
@ foreach tag {add rm chng} {
@ $txt tag config $tag -background $CFG([string toupper $tag]_BG)
@ $txt tag lower $tag
@ }
@ }
@ text .mkr
@
@ font create mono -family courier -size $CFG(FONT_SIZE)
@ foreach font $CFG(FONTS) {
@ if {[lsearch -exact [font families] $font] != -1} {
@ font config mono -family $font
|