Fossil SCM
Add the "Invert" button to the --tk diff display.
Commit
cf52a9ab7bbff4f36d5206596263691c6ee718d8
Parent
ebe97b79f21a024…
1 file changed
+27
-1
+27
-1
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -943,13 +943,39 @@ | ||
| 943 | 943 | @ foreach e $::difftxt {puts $out [list $e]} |
| 944 | 944 | @ puts $out "\175" |
| 945 | 945 | @ puts $out "eval \$prog" |
| 946 | 946 | @ close $out |
| 947 | 947 | @ } |
| 948 | +@ proc invertDiff {} { | |
| 949 | +@ global CFG | |
| 950 | +@ array set x [grid info .txtA] | |
| 951 | +@ if {$x(-column)==1} { | |
| 952 | +@ grid config .lnB -column 0 | |
| 953 | +@ grid config .txtB -column 1 | |
| 954 | +@ .txtB tag config add -background $CFG(RM_BG) | |
| 955 | +@ grid config .lnA -column 3 | |
| 956 | +@ grid config .txtA -column 4 | |
| 957 | +@ .txtA tag config rm -background $CFG(ADD_BG) | |
| 958 | +@ } else { | |
| 959 | +@ grid config .lnA -column 0 | |
| 960 | +@ grid config .txtA -column 1 | |
| 961 | +@ .txtA tag config rm -background $CFG(RM_BG) | |
| 962 | +@ grid config .lnB -column 3 | |
| 963 | +@ grid config .txtB -column 4 | |
| 964 | +@ .txtB tag config add -background $CFG(ADD_BG) | |
| 965 | +@ } | |
| 966 | +@ .mkr config -state normal | |
| 967 | +@ set clt [.mkr search -all < 1.0 end] | |
| 968 | +@ set cgt [.mkr search -all > 1.0 end] | |
| 969 | +@ foreach c $clt {.mkr replace $c "$c +1 chars" >} | |
| 970 | +@ foreach c $cgt {.mkr replace $c "$c +1 chars" <} | |
| 971 | +@ .mkr config -state disabled | |
| 972 | +@ } | |
| 948 | 973 | @ ::ttk::button .bb.quit -text {Quit} -command exit |
| 974 | +@ ::ttk::button .bb.invert -text {Invert} -command invertDiff | |
| 949 | 975 | @ ::ttk::button .bb.save -text {Save As...} -command saveDiff |
| 950 | -@ pack .bb.quit -side left | |
| 976 | +@ pack .bb.quit .bb.invert -side left | |
| 951 | 977 | @ if {$fossilcmd!=""} {pack .bb.save -side left} |
| 952 | 978 | @ pack .bb.files -side left |
| 953 | 979 | @ grid rowconfigure . 1 -weight 1 |
| 954 | 980 | @ grid columnconfigure . 1 -weight 1 |
| 955 | 981 | @ grid columnconfigure . 4 -weight 1 |
| 956 | 982 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -943,13 +943,39 @@ | |
| 943 | @ foreach e $::difftxt {puts $out [list $e]} |
| 944 | @ puts $out "\175" |
| 945 | @ puts $out "eval \$prog" |
| 946 | @ close $out |
| 947 | @ } |
| 948 | @ ::ttk::button .bb.quit -text {Quit} -command exit |
| 949 | @ ::ttk::button .bb.save -text {Save As...} -command saveDiff |
| 950 | @ pack .bb.quit -side left |
| 951 | @ if {$fossilcmd!=""} {pack .bb.save -side left} |
| 952 | @ pack .bb.files -side left |
| 953 | @ grid rowconfigure . 1 -weight 1 |
| 954 | @ grid columnconfigure . 1 -weight 1 |
| 955 | @ grid columnconfigure . 4 -weight 1 |
| 956 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -943,13 +943,39 @@ | |
| 943 | @ foreach e $::difftxt {puts $out [list $e]} |
| 944 | @ puts $out "\175" |
| 945 | @ puts $out "eval \$prog" |
| 946 | @ close $out |
| 947 | @ } |
| 948 | @ proc invertDiff {} { |
| 949 | @ global CFG |
| 950 | @ array set x [grid info .txtA] |
| 951 | @ if {$x(-column)==1} { |
| 952 | @ grid config .lnB -column 0 |
| 953 | @ grid config .txtB -column 1 |
| 954 | @ .txtB tag config add -background $CFG(RM_BG) |
| 955 | @ grid config .lnA -column 3 |
| 956 | @ grid config .txtA -column 4 |
| 957 | @ .txtA tag config rm -background $CFG(ADD_BG) |
| 958 | @ } else { |
| 959 | @ grid config .lnA -column 0 |
| 960 | @ grid config .txtA -column 1 |
| 961 | @ .txtA tag config rm -background $CFG(RM_BG) |
| 962 | @ grid config .lnB -column 3 |
| 963 | @ grid config .txtB -column 4 |
| 964 | @ .txtB tag config add -background $CFG(ADD_BG) |
| 965 | @ } |
| 966 | @ .mkr config -state normal |
| 967 | @ set clt [.mkr search -all < 1.0 end] |
| 968 | @ set cgt [.mkr search -all > 1.0 end] |
| 969 | @ foreach c $clt {.mkr replace $c "$c +1 chars" >} |
| 970 | @ foreach c $cgt {.mkr replace $c "$c +1 chars" <} |
| 971 | @ .mkr config -state disabled |
| 972 | @ } |
| 973 | @ ::ttk::button .bb.quit -text {Quit} -command exit |
| 974 | @ ::ttk::button .bb.invert -text {Invert} -command invertDiff |
| 975 | @ ::ttk::button .bb.save -text {Save As...} -command saveDiff |
| 976 | @ pack .bb.quit .bb.invert -side left |
| 977 | @ if {$fossilcmd!=""} {pack .bb.save -side left} |
| 978 | @ pack .bb.files -side left |
| 979 | @ grid rowconfigure . 1 -weight 1 |
| 980 | @ grid columnconfigure . 1 -weight 1 |
| 981 | @ grid columnconfigure . 4 -weight 1 |
| 982 |