︙ | | | ︙ | |
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
|
set lines [lsort -integer [regexp -all -inline {\d+} $t]]
set froml [lindex $lines 0]
set tol [lindex $lines end]
set ::eskil($top,separatelines$n) [list $froml $tol]
if {[info exists ::eskil($top,separate1)] && \
[info exists ::eskil($top,separate2)]} {
if {1} {
cloneDiff $top [concat $::eskil($top,separatelines1) \
$::eskil($top,separatelines2)]
} else {
set f1 [tmpFile]
set f2 [tmpFile]
set ch [open $f1 w]
puts $ch $::eskil($top,separatetext1)
close $ch
set ch [open $f2 w]
puts $ch $::eskil($top,separatetext2)
close $ch
newDiff $f1 $f2
}
unset ::eskil($top,separate1)
unset ::eskil($top,separate2)
}
}
proc hlPopup {top n hl X Y x y} {
if {[info exists ::eskil($top,nopopup)] && $::eskil($top,nopopup)} return
|
<
|
|
<
<
<
<
<
<
<
<
<
<
<
<
|
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
|
set lines [lsort -integer [regexp -all -inline {\d+} $t]]
set froml [lindex $lines 0]
set tol [lindex $lines end]
set ::eskil($top,separatelines$n) [list $froml $tol]
if {[info exists ::eskil($top,separate1)] && \
[info exists ::eskil($top,separate2)]} {
cloneDiff $top [concat $::eskil($top,separatelines1) \
$::eskil($top,separatelines2)]
unset ::eskil($top,separate1)
unset ::eskil($top,separate2)
}
}
proc hlPopup {top n hl X Y x y} {
if {[info exists ::eskil($top,nopopup)] && $::eskil($top,nopopup)} return
|
︙ | | | ︙ | |
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
|
doDiff $top
return $top
}
# Create a new diff window equal to another, except for possibly a range
proc cloneDiff {other {range {}}} {
set top [makeDiffWin]
update
foreach item [array names ::eskil $other,*] {
regsub {^[^,]*,} $item {} item
set ::eskil($top,$item) $::eskil($other,$item)
}
if {[llength $range] != 0} {
|
|
|
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
|
doDiff $top
return $top
}
# Create a new diff window equal to another, except for possibly a range
proc cloneDiff {other {range {}}} {
set top [makeDiffWin $other]
update
foreach item [array names ::eskil $other,*] {
regsub {^[^,]*,} $item {} item
set ::eskil($top,$item) $::eskil($other,$item)
}
if {[llength $range] != 0} {
|
︙ | | | ︙ | |
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
|
$dMenu add command -label "Normal Cursor" \
-command [list normalCursor $top]
$dMenu add separator
# Runtime disable of C version of DiffUtil
$dMenu add command -label "Tcl DiffUtil" -command DisableDiffUtilC
$dMenu add command -label "Evalstats" -command {evalstats}
$dMenu add command -label "_stats" -command {parray _stats}
$dMenu add command -label "Nuisance" -command [list makeNuisance \
$top "It looks like you are trying out the debug menu."]
}
# Build the main window
proc makeDiffWin {} {
global tcl_platform
# Locate a free toplevel name
if {[info exists ::eskil(topDiffCnt)]} {
set t $::eskil(topDiffCnt)
} else {
set t 0
|
<
<
>
|
|
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
|
$dMenu add command -label "Normal Cursor" \
-command [list normalCursor $top]
$dMenu add separator
# Runtime disable of C version of DiffUtil
$dMenu add command -label "Tcl DiffUtil" -command DisableDiffUtilC
$dMenu add command -label "Evalstats" -command {evalstats}
$dMenu add command -label "_stats" -command {parray _stats}
}
# Build the main window
# "other" is related window. Currently unused
proc makeDiffWin {{other {}}} {
global tcl_platform
# Locate a free toplevel name
if {[info exists ::eskil(topDiffCnt)]} {
set t $::eskil(topDiffCnt)
} else {
set t 0
|
︙ | | | ︙ | |
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
|
$top.m.ms add command -label "Text search not available" \
-state disabled
}
$top.m add cascade -label "Tools" -underline 0 -menu $top.m.mt
menu $top.m.mt
$top.m.mt add command -label "New Diff Window" -underline 0 \
-command makeDiffWin
$top.m.mt add command -label "Directory Diff" -underline 0 \
-command makeDirDiffWin
$top.m.mt add command -label "Clip Diff" -underline 0 \
-command makeClipDiffWin
$top.m.mt add command -label "Merge" -underline 0 \
-command [list makeMergeWin $top] -state disabled
$top.m.mt add command -label "Edit Mode" -underline 0 \
|
|
|
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
|
$top.m.ms add command -label "Text search not available" \
-state disabled
}
$top.m add cascade -label "Tools" -underline 0 -menu $top.m.mt
menu $top.m.mt
$top.m.mt add command -label "New Diff Window" -underline 0 \
-command [list makeDiffWin $top]
$top.m.mt add command -label "Directory Diff" -underline 0 \
-command makeDirDiffWin
$top.m.mt add command -label "Clip Diff" -underline 0 \
-command makeClipDiffWin
$top.m.mt add command -label "Merge" -underline 0 \
-command [list makeMergeWin $top] -state disabled
$top.m.mt add command -label "Edit Mode" -underline 0 \
|
︙ | | | ︙ | |
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
|
set ReturnAfterLoop 0
set first 1
foreach file $files {
if {$first} {
set first 0
} else {
# Create new window for other files
set top [makeDiffWin]
update
# It is preferable to see the end if the rev string is too long
$::widgets($top,rev1) xview end
$::widgets($top,rev2) xview end
}
set fullname $file
set fulldir [file dirname $fullname]
|
|
|
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
|
set ReturnAfterLoop 0
set first 1
foreach file $files {
if {$first} {
set first 0
} else {
# Create new window for other files
set top [makeDiffWin $top]
update
# It is preferable to see the end if the rev string is too long
$::widgets($top,rev1) xview end
$::widgets($top,rev2) xview end
}
set fullname $file
set fulldir [file dirname $fullname]
|
︙ | | | ︙ | |