Fossil SCM

Tweaks to diff formatting.

drh 2021-08-31 22:43 diff-color-enhancements
Commit 598d7736e75b438b6d1471f301107677b9cd7fbbf3f84b6b1ab2f73ff90f4eb0
+5 -1
--- src/default.css
+++ src/default.css
@@ -532,11 +532,10 @@
532532
padding-top: 1px;
533533
}
534534
table.sbsdiffcols {
535535
width: 90%;
536536
border-spacing: 0;
537
- font-size: small;
538537
}
539538
table.sbsdiffcols td {
540539
padding: 0;
541540
vertical-align: top;
542541
}
@@ -560,16 +559,19 @@
560559
div.diffmkrcol {
561560
padding: 0 1em;
562561
}
563562
span.diffchng {
564563
background-color: #c0c0ff;
564
+ font-weight: bold;
565565
}
566566
span.diffadd {
567567
background-color: #c0ffc0;
568
+ font-weight: bold;
568569
}
569570
span.diffrm {
570571
background-color: #ffc8c8;
572
+ font-weight: bold;
571573
}
572574
span.diffhr {
573575
display: inline-block;
574576
margin: .5em 0 1em;
575577
color: #0000ff;
@@ -597,14 +599,16 @@
597599
text-decoration: none;
598600
}
599601
pre.udifftxt ins mark {
600602
background-color: #a0e4b2;
601603
text-decoration: none;
604
+ font-weight: bold;
602605
}
603606
pre.udifftxt del mark {
604607
background-color: #ffc0c0;
605608
text-decoration: none;
609
+ font-weight: bold;
606610
}
607611
608612
span.modpending {
609613
color: #b03800;
610614
font-style: italic;
611615
--- src/default.css
+++ src/default.css
@@ -532,11 +532,10 @@
532 padding-top: 1px;
533 }
534 table.sbsdiffcols {
535 width: 90%;
536 border-spacing: 0;
537 font-size: small;
538 }
539 table.sbsdiffcols td {
540 padding: 0;
541 vertical-align: top;
542 }
@@ -560,16 +559,19 @@
560 div.diffmkrcol {
561 padding: 0 1em;
562 }
563 span.diffchng {
564 background-color: #c0c0ff;
 
565 }
566 span.diffadd {
567 background-color: #c0ffc0;
 
568 }
569 span.diffrm {
570 background-color: #ffc8c8;
 
571 }
572 span.diffhr {
573 display: inline-block;
574 margin: .5em 0 1em;
575 color: #0000ff;
@@ -597,14 +599,16 @@
597 text-decoration: none;
598 }
599 pre.udifftxt ins mark {
600 background-color: #a0e4b2;
601 text-decoration: none;
 
602 }
603 pre.udifftxt del mark {
604 background-color: #ffc0c0;
605 text-decoration: none;
 
606 }
607
608 span.modpending {
609 color: #b03800;
610 font-style: italic;
611
--- src/default.css
+++ src/default.css
@@ -532,11 +532,10 @@
532 padding-top: 1px;
533 }
534 table.sbsdiffcols {
535 width: 90%;
536 border-spacing: 0;
 
537 }
538 table.sbsdiffcols td {
539 padding: 0;
540 vertical-align: top;
541 }
@@ -560,16 +559,19 @@
559 div.diffmkrcol {
560 padding: 0 1em;
561 }
562 span.diffchng {
563 background-color: #c0c0ff;
564 font-weight: bold;
565 }
566 span.diffadd {
567 background-color: #c0ffc0;
568 font-weight: bold;
569 }
570 span.diffrm {
571 background-color: #ffc8c8;
572 font-weight: bold;
573 }
574 span.diffhr {
575 display: inline-block;
576 margin: .5em 0 1em;
577 color: #0000ff;
@@ -597,14 +599,16 @@
599 text-decoration: none;
600 }
601 pre.udifftxt ins mark {
602 background-color: #a0e4b2;
603 text-decoration: none;
604 font-weight: bold;
605 }
606 pre.udifftxt del mark {
607 background-color: #ffc0c0;
608 text-decoration: none;
609 font-weight: bold;
610 }
611
612 span.modpending {
613 color: #b03800;
614 font-style: italic;
615
+5 -4
--- src/diff.c
+++ src/diff.c
@@ -1898,26 +1898,27 @@
18981898
int iCol = 0;
18991899
dfunifiedEmitInsert(p);
19001900
p->lnLeft++;
19011901
p->lnRight++;
19021902
blob_appendf(p->pOut,"%6d %6d \n", p->lnLeft, p->lnRight);
1903
+ blob_append(&p->aCol[0], " ", 2);
19031904
jsonize_to_blob(&p->aCol[0], pLine->z, (int)pLine->n, &iCol);
19041905
blob_append_char(&p->aCol[0], '\n');
19051906
}
19061907
static void dfunifiedInsert(DiffBuilder *p, const DLine *pLine){
19071908
int iCol = 0;
19081909
p->lnRight++;
19091910
blob_appendf(&p->aCol[1],"<ins> %6d </ins>\n", p->lnRight);
1910
- blob_append(&p->aCol[2],"<ins><mark>",-1);
1911
+ blob_append(&p->aCol[2],"<ins>+ <mark>",-1);
19111912
jsonize_to_blob(&p->aCol[2], pLine->z, (int)pLine->n, &iCol);
19121913
blob_append(&p->aCol[2], "</mark></ins>\n", -1);
19131914
}
19141915
static void dfunifiedDelete(DiffBuilder *p, const DLine *pLine){
19151916
int iCol = 0;
19161917
p->lnLeft++;
19171918
blob_appendf(p->pOut,"<del>%6d </del>\n", p->lnLeft);
1918
- blob_append(&p->aCol[0],"<del><mark>",-1);
1919
+ blob_append(&p->aCol[0],"<del>- <mark>",-1);
19191920
jsonize_to_blob(&p->aCol[0], pLine->z, (int)pLine->n, &iCol);
19201921
blob_append(&p->aCol[0], "</mark></del>\n", -1);
19211922
}
19221923
static void dfunifiedEdit(DiffBuilder *p, const DLine *pX, const DLine *pY){
19231924
int i;
@@ -1926,11 +1927,11 @@
19261927
ChangeSpan span;
19271928
oneLineChange(pX, pY, &span);
19281929
p->lnLeft++;
19291930
p->lnRight++;
19301931
blob_appendf(p->pOut,"<del>%6d </del>\n", p->lnLeft);
1931
- blob_append(&p->aCol[0], "<del>", -1);
1932
+ blob_append(&p->aCol[0], "<del>- ", -1);
19321933
for(i=x=iCol=0; i<span.n; i++){
19331934
int ofst = span.a[i].iStart1;
19341935
int len = span.a[i].iLen1;
19351936
if( len ){
19361937
jsonize_to_blob(&p->aCol[0], pX->z+x, ofst - x, &iCol);
@@ -1942,11 +1943,11 @@
19421943
}
19431944
}
19441945
if( x<pX->n ) jsonize_to_blob(&p->aCol[0], pX->z+x, pX->n - x, &iCol);
19451946
blob_append(&p->aCol[0], "</del>\n", -1);
19461947
blob_appendf(&p->aCol[1],"<ins> %6d </ins>\n", p->lnRight);
1947
- blob_append(&p->aCol[2], "<ins>", -1);
1948
+ blob_append(&p->aCol[2], "<ins>+ ", -1);
19481949
for(i=x=iCol=0; i<span.n; i++){
19491950
int ofst = span.a[i].iStart2;
19501951
int len = span.a[i].iLen2;
19511952
if( len ){
19521953
jsonize_to_blob(&p->aCol[2], pY->z+x, ofst - x, &iCol);
19531954
--- src/diff.c
+++ src/diff.c
@@ -1898,26 +1898,27 @@
1898 int iCol = 0;
1899 dfunifiedEmitInsert(p);
1900 p->lnLeft++;
1901 p->lnRight++;
1902 blob_appendf(p->pOut,"%6d %6d \n", p->lnLeft, p->lnRight);
 
1903 jsonize_to_blob(&p->aCol[0], pLine->z, (int)pLine->n, &iCol);
1904 blob_append_char(&p->aCol[0], '\n');
1905 }
1906 static void dfunifiedInsert(DiffBuilder *p, const DLine *pLine){
1907 int iCol = 0;
1908 p->lnRight++;
1909 blob_appendf(&p->aCol[1],"<ins> %6d </ins>\n", p->lnRight);
1910 blob_append(&p->aCol[2],"<ins><mark>",-1);
1911 jsonize_to_blob(&p->aCol[2], pLine->z, (int)pLine->n, &iCol);
1912 blob_append(&p->aCol[2], "</mark></ins>\n", -1);
1913 }
1914 static void dfunifiedDelete(DiffBuilder *p, const DLine *pLine){
1915 int iCol = 0;
1916 p->lnLeft++;
1917 blob_appendf(p->pOut,"<del>%6d </del>\n", p->lnLeft);
1918 blob_append(&p->aCol[0],"<del><mark>",-1);
1919 jsonize_to_blob(&p->aCol[0], pLine->z, (int)pLine->n, &iCol);
1920 blob_append(&p->aCol[0], "</mark></del>\n", -1);
1921 }
1922 static void dfunifiedEdit(DiffBuilder *p, const DLine *pX, const DLine *pY){
1923 int i;
@@ -1926,11 +1927,11 @@
1926 ChangeSpan span;
1927 oneLineChange(pX, pY, &span);
1928 p->lnLeft++;
1929 p->lnRight++;
1930 blob_appendf(p->pOut,"<del>%6d </del>\n", p->lnLeft);
1931 blob_append(&p->aCol[0], "<del>", -1);
1932 for(i=x=iCol=0; i<span.n; i++){
1933 int ofst = span.a[i].iStart1;
1934 int len = span.a[i].iLen1;
1935 if( len ){
1936 jsonize_to_blob(&p->aCol[0], pX->z+x, ofst - x, &iCol);
@@ -1942,11 +1943,11 @@
1942 }
1943 }
1944 if( x<pX->n ) jsonize_to_blob(&p->aCol[0], pX->z+x, pX->n - x, &iCol);
1945 blob_append(&p->aCol[0], "</del>\n", -1);
1946 blob_appendf(&p->aCol[1],"<ins> %6d </ins>\n", p->lnRight);
1947 blob_append(&p->aCol[2], "<ins>", -1);
1948 for(i=x=iCol=0; i<span.n; i++){
1949 int ofst = span.a[i].iStart2;
1950 int len = span.a[i].iLen2;
1951 if( len ){
1952 jsonize_to_blob(&p->aCol[2], pY->z+x, ofst - x, &iCol);
1953
--- src/diff.c
+++ src/diff.c
@@ -1898,26 +1898,27 @@
1898 int iCol = 0;
1899 dfunifiedEmitInsert(p);
1900 p->lnLeft++;
1901 p->lnRight++;
1902 blob_appendf(p->pOut,"%6d %6d \n", p->lnLeft, p->lnRight);
1903 blob_append(&p->aCol[0], " ", 2);
1904 jsonize_to_blob(&p->aCol[0], pLine->z, (int)pLine->n, &iCol);
1905 blob_append_char(&p->aCol[0], '\n');
1906 }
1907 static void dfunifiedInsert(DiffBuilder *p, const DLine *pLine){
1908 int iCol = 0;
1909 p->lnRight++;
1910 blob_appendf(&p->aCol[1],"<ins> %6d </ins>\n", p->lnRight);
1911 blob_append(&p->aCol[2],"<ins>+ <mark>",-1);
1912 jsonize_to_blob(&p->aCol[2], pLine->z, (int)pLine->n, &iCol);
1913 blob_append(&p->aCol[2], "</mark></ins>\n", -1);
1914 }
1915 static void dfunifiedDelete(DiffBuilder *p, const DLine *pLine){
1916 int iCol = 0;
1917 p->lnLeft++;
1918 blob_appendf(p->pOut,"<del>%6d </del>\n", p->lnLeft);
1919 blob_append(&p->aCol[0],"<del>- <mark>",-1);
1920 jsonize_to_blob(&p->aCol[0], pLine->z, (int)pLine->n, &iCol);
1921 blob_append(&p->aCol[0], "</mark></del>\n", -1);
1922 }
1923 static void dfunifiedEdit(DiffBuilder *p, const DLine *pX, const DLine *pY){
1924 int i;
@@ -1926,11 +1927,11 @@
1927 ChangeSpan span;
1928 oneLineChange(pX, pY, &span);
1929 p->lnLeft++;
1930 p->lnRight++;
1931 blob_appendf(p->pOut,"<del>%6d </del>\n", p->lnLeft);
1932 blob_append(&p->aCol[0], "<del>- ", -1);
1933 for(i=x=iCol=0; i<span.n; i++){
1934 int ofst = span.a[i].iStart1;
1935 int len = span.a[i].iLen1;
1936 if( len ){
1937 jsonize_to_blob(&p->aCol[0], pX->z+x, ofst - x, &iCol);
@@ -1942,11 +1943,11 @@
1943 }
1944 }
1945 if( x<pX->n ) jsonize_to_blob(&p->aCol[0], pX->z+x, pX->n - x, &iCol);
1946 blob_append(&p->aCol[0], "</del>\n", -1);
1947 blob_appendf(&p->aCol[1],"<ins> %6d </ins>\n", p->lnRight);
1948 blob_append(&p->aCol[2], "<ins>+ ", -1);
1949 for(i=x=iCol=0; i<span.n; i++){
1950 int ofst = span.a[i].iStart2;
1951 int len = span.a[i].iLen2;
1952 if( len ){
1953 jsonize_to_blob(&p->aCol[2], pY->z+x, ofst - x, &iCol);
1954
+5 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -188,11 +188,10 @@
188188
@ <meta charset="UTF-8">
189189
@ <style>
190190
@ table.sbsdiffcols {
191191
@ width: 90%%;
192192
@ border-spacing: 0;
193
-@ font-size: small;
194193
@ }
195194
@ table.sbsdiffcols td {
196195
@ padding: 0;
197196
@ vertical-align: top;
198197
@ }
@@ -213,16 +212,19 @@
213212
@ div.diffmkrcol {
214213
@ padding: 0 1em;
215214
@ }
216215
@ span.diffchng {
217216
@ background-color: #c0c0ff;
217
+@ text-weight: bold;
218218
@ }
219219
@ span.diffadd {
220220
@ background-color: #c0ffc0;
221
+@ text-weight: bold;
221222
@ }
222223
@ span.diffrm {
223224
@ background-color: #ffc8c8;
225
+@ text-weight: bold;
224226
@ }
225227
@ span.diffhr {
226228
@ display: inline-block;
227229
@ margin: .5em 0 1em;
228230
@ color: #0000ff;
@@ -254,14 +256,16 @@
254256
@ text-decoration: none;
255257
@ }
256258
@ pre.udifftxt ins mark {
257259
@ background-color: #a0e4b2;
258260
@ text-decoration: none;
261
+@ text-weight: bold;
259262
@ }
260263
@ pre.udifftxt del mark {
261264
@ background-color: #ffc0c0;
262265
@ text-decoration: none;
266
+@ text-weight: bold;
263267
@ }
264268
@ h1 {
265269
@ font-size: 150%%;
266270
@ }
267271
@ </style>
268272
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -188,11 +188,10 @@
188 @ <meta charset="UTF-8">
189 @ <style>
190 @ table.sbsdiffcols {
191 @ width: 90%%;
192 @ border-spacing: 0;
193 @ font-size: small;
194 @ }
195 @ table.sbsdiffcols td {
196 @ padding: 0;
197 @ vertical-align: top;
198 @ }
@@ -213,16 +212,19 @@
213 @ div.diffmkrcol {
214 @ padding: 0 1em;
215 @ }
216 @ span.diffchng {
217 @ background-color: #c0c0ff;
 
218 @ }
219 @ span.diffadd {
220 @ background-color: #c0ffc0;
 
221 @ }
222 @ span.diffrm {
223 @ background-color: #ffc8c8;
 
224 @ }
225 @ span.diffhr {
226 @ display: inline-block;
227 @ margin: .5em 0 1em;
228 @ color: #0000ff;
@@ -254,14 +256,16 @@
254 @ text-decoration: none;
255 @ }
256 @ pre.udifftxt ins mark {
257 @ background-color: #a0e4b2;
258 @ text-decoration: none;
 
259 @ }
260 @ pre.udifftxt del mark {
261 @ background-color: #ffc0c0;
262 @ text-decoration: none;
 
263 @ }
264 @ h1 {
265 @ font-size: 150%%;
266 @ }
267 @ </style>
268
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -188,11 +188,10 @@
188 @ <meta charset="UTF-8">
189 @ <style>
190 @ table.sbsdiffcols {
191 @ width: 90%%;
192 @ border-spacing: 0;
 
193 @ }
194 @ table.sbsdiffcols td {
195 @ padding: 0;
196 @ vertical-align: top;
197 @ }
@@ -213,16 +212,19 @@
212 @ div.diffmkrcol {
213 @ padding: 0 1em;
214 @ }
215 @ span.diffchng {
216 @ background-color: #c0c0ff;
217 @ text-weight: bold;
218 @ }
219 @ span.diffadd {
220 @ background-color: #c0ffc0;
221 @ text-weight: bold;
222 @ }
223 @ span.diffrm {
224 @ background-color: #ffc8c8;
225 @ text-weight: bold;
226 @ }
227 @ span.diffhr {
228 @ display: inline-block;
229 @ margin: .5em 0 1em;
230 @ color: #0000ff;
@@ -254,14 +256,16 @@
256 @ text-decoration: none;
257 @ }
258 @ pre.udifftxt ins mark {
259 @ background-color: #a0e4b2;
260 @ text-decoration: none;
261 @ text-weight: bold;
262 @ }
263 @ pre.udifftxt del mark {
264 @ background-color: #ffc0c0;
265 @ text-decoration: none;
266 @ text-weight: bold;
267 @ }
268 @ h1 {
269 @ font-size: 150%%;
270 @ }
271 @ </style>
272

Keyboard Shortcuts

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