︙ | | | ︙ | |
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
|
enableRedo $top
}
busyCursor $top
resetEdit $top
# Clear up everything before starting processing
foreach item {wLine1 wDiff1 wLine2 wDiff2} {
set w $::widgets($top,$item)
$w configure -state normal
$w delete 1.0 end
}
clearMap $top
set ::HighLightCount 0
highLightChange $top -1
# Display a star during diff execution, to know when the internal
# processing starts, and when the label is "valid".
set ::widgets($top,eqLabel) "*"
wm title $top "Eskil:"
update idletasks
if {$::eskil($top,mode) eq "patch"} {
disallowEdit $top
displayPatch $top
drawMap $top -1
foreach item {wLine1 wLine2} {
set w $::widgets($top,$item)
$w configure -state disabled
}
update idletasks
wm title $top "Eskil: [file tail $::eskil($top,patchFile)]"
$::widgets($top,wLine2) see 1.0
|
|
>
|
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
|
enableRedo $top
}
busyCursor $top
resetEdit $top
# Clear up everything before starting processing
foreach item {wLine1 wDiff1 wLine2 wDiff2 wTb} {
set w $::widgets($top,$item)
$w configure -state normal
$w delete 1.0 end
}
clearMap $top
set ::HighLightCount 0
highLightChange $top -1
# Display a star during diff execution, to know when the internal
# processing starts, and when the label is "valid".
set ::widgets($top,eqLabel) "*"
wm title $top "Eskil:"
update idletasks
if {$::eskil($top,mode) eq "patch"} {
disallowEdit $top
displayPatch $top
drawMap $top -1
#drawEditButtons $top
foreach item {wLine1 wLine2} {
set w $::widgets($top,$item)
$w configure -state disabled
}
update idletasks
wm title $top "Eskil: [file tail $::eskil($top,patchFile)]"
$::widgets($top,wLine2) see 1.0
|
︙ | | | ︙ | |
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
|
$::widgets($top,wLine2) tag add align \
"$i linestart" "$i lineend"
}
}
}
drawMap $top -1
foreach item {wLine1 wLine2} {
set w $::widgets($top,$item)
$w configure -state disabled
}
update idletasks
$::widgets($top,wLine2) see 1.0
normalCursor $top
showDiff $top 0
|
>
|
|
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
|
$::widgets($top,wLine2) tag add align \
"$i linestart" "$i lineend"
}
}
}
drawMap $top -1
#drawEditButtons $top
foreach item {wLine1 wLine2 wTb} {
set w $::widgets($top,$item)
$w configure -state disabled
}
update idletasks
$::widgets($top,wLine2) see 1.0
normalCursor $top
showDiff $top 0
|
︙ | | | ︙ | |
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
|
# Returns 1 if nothing was added.
proc editMenu {m top n hl x y} {
if {![mayEdit $top $n]} {return 1}
# Only copy when in a change block
if {$hl ne ""} {
set o [expr {3 - $n}]
set editOther [mayEdit $top $o]
set w $::widgets($top,wLine$n)
set wo $::widgets($top,wLine$o)
# Get the row that was clicked
set index [$w index @$x,$y]
|
|
|
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
|
# Returns 1 if nothing was added.
proc editMenu {m top n hl x y} {
if {![mayEdit $top $n]} {return 1}
# Only copy when in a change block
if {$hl ne ""} {
set o [expr {3 - $n}] ;# switch 1 <-> 2
set editOther [mayEdit $top $o]
set w $::widgets($top,wLine$n)
set wo $::widgets($top,wLine$o)
# Get the row that was clicked
set index [$w index @$x,$y]
|
︙ | | | ︙ | |
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
|
toplevel $top
eskilRegisterToplevel $top
wm title $top "Eskil:"
wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top]
ttk::frame $top.f
grid $top.f -row 0 -columnspan 4 -sticky nws
lappend ::widgets(toolbars) $top.f
if {!$::Pref(toolbar)} {
grid remove $top.f
}
menu $top.m
$top configure -menu $top.m
|
|
|
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
|
toplevel $top
eskilRegisterToplevel $top
wm title $top "Eskil:"
wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top]
ttk::frame $top.f
grid $top.f -row 0 -columnspan 5 -sticky nws
lappend ::widgets(toolbars) $top.f
if {!$::Pref(toolbar)} {
grid remove $top.f
}
menu $top.m
$top configure -menu $top.m
|
︙ | | | ︙ | |
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
|
pack $top.ft2.tl -side left -fill y
pack $top.ft2.f -side left -fill y
pack $top.ft2.tt -side right -fill both -expand 1
ttk::scrollbar $top.sbx2 -orient horizontal \
-command [list $top.ft2.tt xview]
set ::widgets($top,wLine2) $top.ft2.tl
set ::widgets($top,wDiff2) $top.ft2.tt
commonYScroll $top.sby $top.ft1.tl $top.ft1.tt $top.ft2.tl $top.ft2.tt
# Set up a tag for incremental search bindings
if {[info procs textSearch::enableSearch] != ""} {
textSearch::enableSearch $top.ft1.tt -label ::widgets($top,isearchLabel)
textSearch::enableSearch $top.ft2.tt -label ::widgets($top,isearchLabel)
}
|
|
|
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
|
pack $top.ft2.tl -side left -fill y
pack $top.ft2.f -side left -fill y
pack $top.ft2.tt -side right -fill both -expand 1
ttk::scrollbar $top.sbx2 -orient horizontal \
-command [list $top.ft2.tt xview]
set ::widgets($top,wLine2) $top.ft2.tl
set ::widgets($top,wDiff2) $top.ft2.tt
#commonYScroll $top.sby $top.ft1.tl $top.ft1.tt $top.ft2.tl $top.ft2.tt
# Set up a tag for incremental search bindings
if {[info procs textSearch::enableSearch] != ""} {
textSearch::enableSearch $top.ft1.tt -label ::widgets($top,isearchLabel)
textSearch::enableSearch $top.ft2.tt -label ::widgets($top,isearchLabel)
}
|
︙ | | | ︙ | |
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
|
addBalloon $top.le "* means external diff is running.\n= means files do\
not differ.\n! means a large block is being processed.\nBlank\
means files differ."
# FIXA: verify that this label is ok after Tile migration
ttk::label $top.ls -width 1 \
-textvariable ::widgets($top,isearchLabel)
addBalloon $top.ls "Incremental search indicator"
set map [createMap $top]
applyColor
foreach w [list $top.ft1.tt $top.ft2.tt] {
# The last change in a row is underlined
$w tag configure last -underline 1
# Each file in a patch view starts with a block of this type
$w tag configure patch -background gray
# Make sure selection is visible
$w tag raise sel
bind $w <ButtonPress-3> "zoomRow %W %X %Y %x %y"
bind $w <ButtonRelease-3> "unzoomRow %W"
}
foreach w [list $top.ft1.tl $top.ft2.tl] {
$w tag configure align -underline 1
bind $w <ButtonPress-3> "rowPopup %W %X %Y %x %y"
}
SetupAlignDrag $top $top.ft1.tl $top.ft2.tl
grid $top.l1 $top.le - $top.l2 -row 1 -sticky news
grid $top.ft1 $map $top.sby $top.ft2 -row 2 -sticky news
grid $top.sbx1 $top.ls - $top.sbx2 -row 3 -sticky news
grid columnconfigure $top {0 3} -weight 1
grid rowconfigure $top 2 -weight 1
grid $map -pady [expr {[winfo reqwidth $top.sby] - 2}]
grid $top.ls -sticky ""
# Allow scrolling from keys at toplevel
bind $top <Key-Up> [list scrollText $top yview scroll -1 u]
bind $top <Key-k> [list scrollText $top yview scroll -1 u]
bind $top <Key-Down> [list scrollText $top yview scroll 1 u]
bind $top <Key-j> [list scrollText $top yview scroll 1 u]
bind $top <Key-Prior> [list scrollText $top yview scroll -1 pa]
|
>
|
>
>
>
>
>
>
>
>
|
|
|
|
|
>
>
>
|
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
|
addBalloon $top.le "* means external diff is running.\n= means files do\
not differ.\n! means a large block is being processed.\nBlank\
means files differ."
# FIXA: verify that this label is ok after Tile migration
ttk::label $top.ls -width 1 \
-textvariable ::widgets($top,isearchLabel)
addBalloon $top.ls "Incremental search indicator"
set bg [ttk::style configure . -background]
set map [createMap $top $bg]
# Edit buttons widget
set ::widgets($top,wTb) $top.tb
text $top.tb -width 4 -wrap none -background $bg \
-font myfont -borderwidth 0 -padx 0 -highlightthickness 0 \
-takefocus 0
commonYScroll $top.sby $top.ft1.tl $top.ft1.tt $top.ft2.tl $top.ft2.tt \
$top.tb
applyColor
foreach w [list $top.ft1.tt $top.ft2.tt] {
# The last change in a row is underlined
$w tag configure last -underline 1
# Each file in a patch view starts with a block of this type
$w tag configure patch -background gray
# Make sure selection is visible
$w tag raise sel
bind $w <ButtonPress-3> "zoomRow %W %X %Y %x %y"
bind $w <ButtonRelease-3> "unzoomRow %W"
}
foreach w [list $top.ft1.tl $top.ft2.tl] {
$w tag configure align -underline 1
bind $w <ButtonPress-3> "rowPopup %W %X %Y %x %y"
}
SetupAlignDrag $top $top.ft1.tl $top.ft2.tl
grid $top.l1 $top.le - - $top.l2 -row 1 -sticky news
grid $top.ft1 $top.tb $map $top.sby $top.ft2 -row 2 -sticky news
grid $top.sbx1 $top.ls - - $top.sbx2 -row 3 -sticky news
grid columnconfigure $top "$top.ft1 $top.ft2" -weight 1
grid rowconfigure $top $top.ft1 -weight 1
grid $top.tb -pady 2
grid $map -pady [expr {[winfo reqwidth $top.sby] - 2}]
grid $top.ls -sticky ""
grid remove $top.tb ;# Hide until done
# Allow scrolling from keys at toplevel
bind $top <Key-Up> [list scrollText $top yview scroll -1 u]
bind $top <Key-k> [list scrollText $top yview scroll -1 u]
bind $top <Key-Down> [list scrollText $top yview scroll 1 u]
bind $top <Key-j> [list scrollText $top yview scroll 1 u]
bind $top <Key-Prior> [list scrollText $top yview scroll -1 pa]
|
︙ | | | ︙ | |