Fossil SCM

The diff --tk option shows an error message on the display if it encounters an input line that it does not understand. This means that "cannot compute difference between binary files" errors, and similar, are dealt with correctly.

drh 2021-09-06 01:22 trunk
Commit 86f0722e0cb0978d4dabfbfa65f550ffced769c6a0c19a38e75004833acf3ca2
1 file changed +5 -1
+5 -1
--- src/diff.tcl
+++ src/diff.tcl
@@ -162,11 +162,15 @@
162162
foreach wx [list [string length $n1] [string length $n2]] {
163163
if {$wx>$widths(ln)} {set widths(ln) $wx}
164164
}
165165
}
166166
default {
167
- error "bad diff source line: $line"
167
+ .lnA insert end \n -
168
+ .txtA insert end $line\n err
169
+ .mkr insert end \n -
170
+ .lnB insert end \n -
171
+ .txtB insert end $line\n err
168172
}
169173
}
170174
}
171175
172176
foreach c [cols] {
173177
--- src/diff.tcl
+++ src/diff.tcl
@@ -162,11 +162,15 @@
162 foreach wx [list [string length $n1] [string length $n2]] {
163 if {$wx>$widths(ln)} {set widths(ln) $wx}
164 }
165 }
166 default {
167 error "bad diff source line: $line"
 
 
 
 
168 }
169 }
170 }
171
172 foreach c [cols] {
173
--- src/diff.tcl
+++ src/diff.tcl
@@ -162,11 +162,15 @@
162 foreach wx [list [string length $n1] [string length $n2]] {
163 if {$wx>$widths(ln)} {set widths(ln) $wx}
164 }
165 }
166 default {
167 .lnA insert end \n -
168 .txtA insert end $line\n err
169 .mkr insert end \n -
170 .lnB insert end \n -
171 .txtB insert end $line\n err
172 }
173 }
174 }
175
176 foreach c [cols] {
177

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button