Fossil SCM
Better control over the blue/red/green colors in the --tk TCL code.
Commit
1df8b9d773b850b45fb14292a12efe2fa20466447c7d2c1bf17f66d0d8a61d46
Parent
b3e1fd9ff44e374…
1 file changed
+10
-2
+10
-2
| --- src/diff.tcl | ||
| +++ src/diff.tcl | ||
| @@ -136,12 +136,20 @@ | ||
| 136 | 136 | if {$x ne ""} { |
| 137 | 137 | .txtA insert end $x - |
| 138 | 138 | .txtB insert end $x - |
| 139 | 139 | } |
| 140 | 140 | if {$i+2<$nn} { |
| 141 | - .txtA insert end [lindex $line [expr {$i+1}]] chng | |
| 142 | - .txtB insert end [lindex $line [expr {$i+2}]] chng | |
| 141 | + set x1 [lindex $line [expr {$i+1}]] | |
| 142 | + set x2 [lindex $line [expr {$i+2}]] | |
| 143 | + if {"$x1" eq ""} { | |
| 144 | + .txtB insert end $x2 add | |
| 145 | + } elseif {"$x2" eq ""} { | |
| 146 | + .txtA insert end $x1 rm | |
| 147 | + } else { | |
| 148 | + .txtA insert end $x1 chng | |
| 149 | + .txtB insert end $x2 chng | |
| 150 | + } | |
| 143 | 151 | } |
| 144 | 152 | } |
| 145 | 153 | .txtA insert end \n - |
| 146 | 154 | .txtB insert end \n - |
| 147 | 155 | } |
| 148 | 156 |
| --- src/diff.tcl | |
| +++ src/diff.tcl | |
| @@ -136,12 +136,20 @@ | |
| 136 | if {$x ne ""} { |
| 137 | .txtA insert end $x - |
| 138 | .txtB insert end $x - |
| 139 | } |
| 140 | if {$i+2<$nn} { |
| 141 | .txtA insert end [lindex $line [expr {$i+1}]] chng |
| 142 | .txtB insert end [lindex $line [expr {$i+2}]] chng |
| 143 | } |
| 144 | } |
| 145 | .txtA insert end \n - |
| 146 | .txtB insert end \n - |
| 147 | } |
| 148 |
| --- src/diff.tcl | |
| +++ src/diff.tcl | |
| @@ -136,12 +136,20 @@ | |
| 136 | if {$x ne ""} { |
| 137 | .txtA insert end $x - |
| 138 | .txtB insert end $x - |
| 139 | } |
| 140 | if {$i+2<$nn} { |
| 141 | set x1 [lindex $line [expr {$i+1}]] |
| 142 | set x2 [lindex $line [expr {$i+2}]] |
| 143 | if {"$x1" eq ""} { |
| 144 | .txtB insert end $x2 add |
| 145 | } elseif {"$x2" eq ""} { |
| 146 | .txtA insert end $x1 rm |
| 147 | } else { |
| 148 | .txtA insert end $x1 chng |
| 149 | .txtB insert end $x2 chng |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | .txtA insert end \n - |
| 154 | .txtB insert end \n - |
| 155 | } |
| 156 |