Fossil

Check-in [4cd8a743]
Login

Check-in [4cd8a743]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:First attempt to generate side-by-side diffs using the new formatter. This breaks the --tk option. The "fossil diff -b" and "--by" work, but side-by-side diff on /info pages and similar is currently busted. CSS is simplified, which means that skins will need to be modified. This is an incremental check-in.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | diff-color-enhancements
Files: files | file ages | folders
SHA3-256: 4cd8a743cd0c1f9614917370486310890cb2133b60a7e104572baca713970235
User & Date: drh 2021-09-01 19:53:18
Context
2021-09-02
09:19
Add the --tcl format option to the diff commands. The plan is to use this to implement --tk (in place of --html -y) but that part is not yet implemented. ... (check-in: e933d5d7 user: drh tags: diff-color-enhancements)
2021-09-01
19:53
First attempt to generate side-by-side diffs using the new formatter. This breaks the --tk option. The "fossil diff -b" and "--by" work, but side-by-side diff on /info pages and similar is currently busted. CSS is simplified, which means that skins will need to be modified. This is an incremental check-in. ... (check-in: 4cd8a743 user: drh tags: diff-color-enhancements)
15:38
Further improvements to unified diff. Simplified CSS that can be used in common with split diff. Separate columns for each line number and the change mark. ... (check-in: ce856a86 user: drh tags: diff-color-enhancements)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/default.css.

527
528
529
530
531
532
533


534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613

614
615
616
617
618
619
620

621
622
623
624
625
626
627
628
629
630
631
ul.filelist {
  margin-top: 3px;
  line-height: 100%;
}
ul.filelist li {
  padding-top: 1px;
}


table.sbsdiffcols {
  width: 90%;
  border-spacing: 0;
}
table.sbsdiffcols td {
  padding: 0;
  vertical-align: top;
}
table.sbsdiffcols pre {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: inherit;
  background: inherit;
  color: inherit;
}
div.difflncol {
  padding-right: 1em;
  text-align: right;
  color: #a0a0a0;
}
div.difftxtcol {
  width: 45em;
  overflow-x: auto;
}
div.diffmkrcol {
  padding: 0 1em;
}
span.diffchng {
  background-color: #c0c0ff;
  font-weight: bold;
}
span.diffadd {
  background-color: #c0ffc0;
  font-weight: bold;
}
span.diffrm {
  background-color: #ffc8c8;
  font-weight: bold;
}
span.diffhr {
  display: inline-block;
  margin: .5em 0 1em;
  color: #0000ff;
}
span.diffln {
  color: #a0a0a0;
}
pre.udiffln {
  color: #a0a0a0;
}
pre.udiffln ins {
  background-color: #a0e4b2;
  text-decoration: none;
}
pre.udiffln del {
  background-color: #ffc0c0;
  text-decoration: none;
}
pre.udifftxt ins {
  background-color: #dafbe1;
  text-decoration: none;
}
pre.udifftxt del {
  background-color: #ffe8e8;
  text-decoration: none;
}
pre.udifftxt ins mark {
  background-color: #a0e4b2;
  text-decoration: none;
  font-weight: bold;
}
pre.udifftxt del mark {
  background-color: #ffc0c0;
  text-decoration: none;
  font-weight: bold;
}

table.diff {
  width: 90%;

  border-spacing: 0;
}
td.diffln {
  text-align: right;
  padding: 0 0 0 1em;
}
td.diffsep {

  padding: 0 0.5em 0 0.5em;
}
td.difftxt {
  width: 100%;
}
td.diffln ins {
  background-color: #a0e4b2;
  text-decoration: none;
}
td.diffln del {
  background-color: #ffc0c0;







>
>
|
|


|
<


|
|
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
>
|

|
<
|


>
|

|
|







527
528
529
530
531
532
533
534
535
536
537
538
539
540

541
542
543
544





545





























546

































547
548
549
550
551

552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
ul.filelist {
  margin-top: 3px;
  line-height: 100%;
}
ul.filelist li {
  padding-top: 1px;
}

/* Rules governing diff layout and colors */
table.diff {
  width: 98%;
  border-spacing: 0;
}
table.diff td {

  vertical-align: top;
}
table.diff pre {
  margin: 0 0 0 0;





}





























td.diffln {

































  width: 1px;
  text-align: right;
  padding: 0 1em 0 0;
}
td.difflne {

  padding-bottom: 0.4em;
}
td.diffsep {
  width: 1px;
  padding: 0 0.3em 0 1em;
}
td.difftxt pre {
  overflow-x: auto;
}
td.diffln ins {
  background-color: #a0e4b2;
  text-decoration: none;
}
td.diffln del {
  background-color: #ffc0c0;
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
  text-decoration: none;
  font-weight: bold;
}
td.difftxt ins {
  background-color: #dafbe1;
  text-decoration: none;
}
td.udifftxt ins > ins {
  background-color: #a0e4b2;
  text-decoration: none;
  font-weight: bold;
}
td.udifftxt ins mark {
  background-color: #c0c0ff;
  text-decoration: none;
  font-weight: bold;
}


span.modpending {







|




|







580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
  text-decoration: none;
  font-weight: bold;
}
td.difftxt ins {
  background-color: #dafbe1;
  text-decoration: none;
}
td.difftxt ins > ins {
  background-color: #a0e4b2;
  text-decoration: none;
  font-weight: bold;
}
td.difftxt ins mark {
  background-color: #c0c0ff;
  text-decoration: none;
  font-weight: bold;
}


span.modpending {

Changes to src/diff.c.

1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
  blob_append(p->pOut,"<tr><td class=\"diffln difflnl\"><pre>\n", -1);
  p->eState = 0;
  p->nPending = 0;
}
static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
  dfunifiedFinishRow(p);
  if( (p->lnLeft || p->lnRight) && !isFinal ){
    blob_append(p->pOut, "<tr><td class=\"diffskip\" colspan=\"2\">"
                         "<hr></td><td></td><td></td></tr>\n", -1);
  }
  p->lnLeft += n;
  p->lnRight += n;
}
static void dfunifiedCommon(DiffBuilder *p, const DLine *pLine){
  int iCol = 0;
  dfunifiedStartRow(p);







|
|







1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
  blob_append(p->pOut,"<tr><td class=\"diffln difflnl\"><pre>\n", -1);
  p->eState = 0;
  p->nPending = 0;
}
static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
  dfunifiedFinishRow(p);
  if( (p->lnLeft || p->lnRight) && !isFinal ){
    blob_append(p->pOut, "<tr><td class=\"diffln difflne\">"
                         "&#xfe19;</td><td></td><td></td></tr>\n", -1);
  }
  p->lnLeft += n;
  p->lnRight += n;
}
static void dfunifiedCommon(DiffBuilder *p, const DLine *pLine){
  int iCol = 0;
  dfunifiedStartRow(p);
2037
2038
2039
2040
2041
2042
2043
2044
















































































































































































2045
2046
2047
2048
2049
2050
2051
  p->xDelete = dfunifiedDelete;
  p->xEdit = dfunifiedEdit;
  p->xEnd = dfunifiedEnd;
  p->lnLeft = p->lnRight = 0;
  p->eState = 0;
  p->nPending = 0;
  p->pOut = pOut;
  blob_append(pOut, "<table class=\"diff\">\n", -1);
















































































































































































  blob_init(&p->aCol[0], 0, 0);
  blob_init(&p->aCol[1], 0, 0);
  blob_init(&p->aCol[2], 0, 0);
  blob_init(&p->aCol[3], 0, 0);
  blob_init(&p->aCol[4], 0, 0);
  return p;
}







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
  p->xDelete = dfunifiedDelete;
  p->xEdit = dfunifiedEdit;
  p->xEnd = dfunifiedEnd;
  p->lnLeft = p->lnRight = 0;
  p->eState = 0;
  p->nPending = 0;
  p->pOut = pOut;
  blob_append(pOut, "<table class=\"diff udiff\">\n", -1);
  blob_init(&p->aCol[0], 0, 0);
  blob_init(&p->aCol[1], 0, 0);
  blob_init(&p->aCol[2], 0, 0);
  blob_init(&p->aCol[3], 0, 0);
  blob_init(&p->aCol[4], 0, 0);
  return p;
}

/************************* DiffBuilderSplit  ******************************/

/* Accumulator strategy:
**
**    *   Left line numbers are output directly to p->pOut
**    *   Left text accumulates in p->aCol[0].
**    *   Edit marks accumulates in p->aCol[1].
**    *   Right line numbers accumulate in p->aCol[2].
**    *   Right text accumulates in p->aCol[3].
**
** eState:
**    0   In common block
**    1   Have <del> on the left
**    2   Have <ins> on the right
**    3   Have <del> on left and <ins> on the right
*/
static void dfsplitChangeState(DiffBuilder *p, int newState){
  if( p->eState == newState ) return;
  if( (p->eState&1)==0 && (newState & 1)!=0 ){
    blob_append(p->pOut, "<del>", 5);
    blob_append(&p->aCol[0], "<del>", 5);
    p->eState |= 1;
  }else if( (p->eState&1)!=0 && (newState & 1)==0 ){
    blob_append(p->pOut, "</del>", 6);
    blob_append(&p->aCol[0], "</del>", 6);
    p->eState &= ~1;
  }
  if( (p->eState&2)==0 && (newState & 2)!=0 ){
    blob_append(&p->aCol[2], "<ins>", 5);
    blob_append(&p->aCol[3], "<ins>", 5);
    p->eState |= 2;
  }else if( (p->eState&2)!=0 && (newState & 2)==0 ){
    blob_append(&p->aCol[2], "</ins>", 6);
    blob_append(&p->aCol[3], "</ins>", 6);
    p->eState &= ~2;
  }
}
static void dfsplitFinishRow(DiffBuilder *p){
  if( blob_size(&p->aCol[0])==0 ) return;
  dfsplitChangeState(p, 0);
  blob_append(p->pOut, "</pre></td><td class=\"difftxt difftxtl\"><pre>\n",-1);
  blob_append_xfer(p->pOut, &p->aCol[0]);
  blob_append(p->pOut, "</pre></td><td class=\"diffsep\"><pre>\n", -1);
  blob_append_xfer(p->pOut, &p->aCol[1]);
  blob_append(p->pOut, "</pre></td><td class=\"diffln difflnr\"><pre>\n",-1);
  blob_append_xfer(p->pOut, &p->aCol[2]);
  blob_append(p->pOut, "</pre></td><td class=\"difftxt difftxtr\"><pre>\n",-1);
  blob_append_xfer(p->pOut, &p->aCol[3]);
  blob_append(p->pOut, "</pre></td></tr>\n", -1);
}
static void dfsplitStartRow(DiffBuilder *p){
  if( blob_size(&p->aCol[0])>0 ) return;
  blob_append(p->pOut,"<tr><td class=\"diffln difflnl\"><pre>\n", -1);
  p->eState = 0;
}
static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
  dfsplitFinishRow(p);
  if( (p->lnLeft || p->lnRight) && !isFinal ){
    blob_append(p->pOut, 
       "<tr><td class=\"diffln difflnl difflne\">&#xfe19;</td>"
       "<td></td><td></td>"
       "<td class=\"diffln difflnr difflne\">&#xfe19;</td>"
       "<td/td></tr>\n", -1);
  }
  p->lnLeft += n;
  p->lnRight += n;
}
static void dfsplitCommon(DiffBuilder *p, const DLine *pLine){
  int iCol = 0;
  dfsplitStartRow(p);
  dfsplitChangeState(p, 0);
  p->lnLeft++;
  p->lnRight++;
  blob_appendf(p->pOut,"%d\n", p->lnLeft);
  jsonize_to_blob(&p->aCol[0], pLine->z, (int)pLine->n, &iCol);
  blob_append_char(&p->aCol[0], '\n');
  blob_append_char(&p->aCol[1], '\n');
  blob_appendf(&p->aCol[2],"%d\n",p->lnRight);
  jsonize_to_blob(&p->aCol[3], pLine->z, (int)pLine->n, &iCol);
  blob_append_char(&p->aCol[3], '\n');
}
static void dfsplitInsert(DiffBuilder *p, const DLine *pLine){
  int iCol = 0;
  dfsplitStartRow(p);
  dfsplitChangeState(p, 2);
  p->lnRight++;
  blob_append_char(p->pOut, '\n');
  blob_append_char(&p->aCol[0], '\n');
  blob_append(&p->aCol[1], "&gt;\n", -1);
  blob_appendf(&p->aCol[2],"%d\n", p->lnRight);
  blob_append(&p->aCol[3], "<ins>", 5);
  jsonize_to_blob(&p->aCol[3], pLine->z, (int)pLine->n, &iCol);
  blob_append(&p->aCol[3], "</ins>\n", 7);
}
static void dfsplitDelete(DiffBuilder *p, const DLine *pLine){
  int iCol = 0;
  dfsplitStartRow(p);
  dfsplitChangeState(p, 1);
  p->lnLeft++;
  blob_appendf(p->pOut,"%d\n", p->lnLeft);
  blob_append(&p->aCol[0], "<del>", 5);
  jsonize_to_blob(&p->aCol[0], pLine->z, (int)pLine->n, &iCol);
  blob_append(&p->aCol[0], "</del>\n", 7);
  blob_append(&p->aCol[1], "&lt;\n", -1);
  blob_append_char(&p->aCol[2],'\n');
  blob_append_char(&p->aCol[3],'\n');
}
static void dfsplitEdit(DiffBuilder *p, const DLine *pX, const DLine *pY){
  int i;
  int x;
  int iCol;
  ChangeSpan span;
  oneLineChange(pX, pY, &span);
  dfsplitStartRow(p);
  dfsplitChangeState(p, 3);
  p->lnLeft++;
  p->lnRight++;
  blob_appendf(p->pOut,"%d\n", p->lnLeft);
  for(i=x=iCol=0; i<span.n; i++){
    int ofst = span.a[i].iStart1;
    int len = span.a[i].iLen1;
    if( len ){
      jsonize_to_blob(&p->aCol[0], pX->z+x, ofst - x, &iCol);
      x = ofst;
      blob_append(&p->aCol[0], "<del>", 5);
      jsonize_to_blob(&p->aCol[0], pX->z+x, len, &iCol);
      x += len;
      blob_append(&p->aCol[0], "</del>", 6);
    }
  }
  if( x<pX->n ) jsonize_to_blob(&p->aCol[0], pX->z+x,  pX->n - x, &iCol);
  blob_append_char(&p->aCol[0], '\n');

  blob_append(&p->aCol[1], "|\n", 2);

  blob_appendf(&p->aCol[2],"%d\n", p->lnRight);
  for(i=x=iCol=0; i<span.n; i++){
    int ofst = span.a[i].iStart2;
    int len = span.a[i].iLen2;
    if( len ){
      jsonize_to_blob(&p->aCol[3], pY->z+x, ofst - x, &iCol);
      x = ofst;
      blob_append(&p->aCol[3], "<ins>", 5);
      jsonize_to_blob(&p->aCol[3], pY->z+x, len, &iCol);
      x += len;
      blob_append(&p->aCol[3], "</ins>", 6);
    }
  }
  if( x<pY->n ) jsonize_to_blob(&p->aCol[3], pY->z+x,  pY->n - x, &iCol);
  blob_append_char(&p->aCol[3], '\n');
}
static void dfsplitEnd(DiffBuilder *p){
  dfsplitFinishRow(p);
  blob_append(p->pOut, "</table>\n",-1);
  fossil_free(p);
}
static DiffBuilder *dfsplitNew(Blob *pOut){
  DiffBuilder *p = fossil_malloc(sizeof(*p));
  p->xSkip = dfsplitSkip;
  p->xCommon = dfsplitCommon;
  p->xInsert = dfsplitInsert;
  p->xDelete = dfsplitDelete;
  p->xEdit = dfsplitEdit;
  p->xEnd = dfsplitEnd;
  p->lnLeft = p->lnRight = 0;
  p->eState = 0;
  p->pOut = pOut;
  blob_append(pOut, "<table class=\"diff splitdiff\">\n", -1);
  blob_init(&p->aCol[0], 0, 0);
  blob_init(&p->aCol[1], 0, 0);
  blob_init(&p->aCol[2], 0, 0);
  blob_init(&p->aCol[3], 0, 0);
  blob_init(&p->aCol[4], 0, 0);
  return p;
}
2772
2773
2774
2775
2776
2777
2778




2779

2780
2781
2782
2783
2784
2785
2786
                     R[r], R[r+1], R[r+2]);
      }
    }else if( diffFlags & DIFF_JSON ){
      DiffBuilder *pBuilder = dfjsonNew(pOut);
      formatDiff(&c, pRe, diffFlags, pBuilder);
      blob_append_char(pOut, '\n');
    }else if( diffFlags & DIFF_SIDEBYSIDE ){




      sbsDiff(&c, pOut, pRe, diffFlags);

    }else if( diffFlags & DIFF_DEBUG ){
      DiffBuilder *pBuilder = dfdebugNew(pOut);
      formatDiff(&c, pRe, diffFlags, pBuilder);
    }else if( diffFlags & DIFF_HTML ){
      DiffBuilder *pBuilder = dfunifiedNew(pOut);
      formatDiff(&c, pRe, diffFlags, pBuilder);
    }else{







>
>
>
>
|
>







2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
                     R[r], R[r+1], R[r+2]);
      }
    }else if( diffFlags & DIFF_JSON ){
      DiffBuilder *pBuilder = dfjsonNew(pOut);
      formatDiff(&c, pRe, diffFlags, pBuilder);
      blob_append_char(pOut, '\n');
    }else if( diffFlags & DIFF_SIDEBYSIDE ){
      if( diffFlags & DIFF_HTML ){
        DiffBuilder *pBuilder = dfsplitNew(pOut);
        formatDiff(&c, pRe, diffFlags, pBuilder);
      }else{
        sbsDiff(&c, pOut, pRe, diffFlags);
      }
    }else if( diffFlags & DIFF_DEBUG ){
      DiffBuilder *pBuilder = dfdebugNew(pOut);
      formatDiff(&c, pRe, diffFlags, pBuilder);
    }else if( diffFlags & DIFF_HTML ){
      DiffBuilder *pBuilder = dfunifiedNew(pOut);
      formatDiff(&c, pRe, diffFlags, pBuilder);
    }else{

Added src/diff.js.

















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* Keeps the horizontal scrollbars* in sync on side-by-side diffs.
*/
(function(){
  var SCROLL_LEN = 25;
  function initDiff(diff){
    var txtCols = diff.querySelectorAll('td.difftxt');
    var txtPres = diff.querySelectorAll('td.difftxt pre');
    var width = Math.max(txtPres[0].scrollWidth, txtPres[1].scrollWidth);
    var i;
    for(i=0; i<txtCols.length; i++){
      txtCols[i].style.width = width + 'px';
      txtPres[i].style.maxWidth = width + 'px';
      txtPres[i].style.width = width + 'px';
      txtCols[i].onscroll = function(e){
        txtCols[0].scrollLeft = txtCols[1].scrollLeft = this.scrollLeft;
      };
    }
    diff.tabIndex = 0;
    diff.onkeydown = function(e){
      e = e || event;
      var len = {37: -SCROLL_LEN, 39: SCROLL_LEN}[e.keyCode];
      if( !len ) return;
      txtCols[0].scrollLeft += len;
      return false;
    };
  }
  var i, diffs = document.querySelectorAll('table.splitdiff')
  for(i=0; i<diffs.length; i++){
    initDiff(diffs[i]);
  }
  if(window.fossil && fossil.page){
    fossil.page.tweakSbsDiffs = function(){
      document.querySelectorAll('table.splitdiff').forEach(initDiff);
    };
  }
  var lastWidth = 0;
  function checkWidth(){
    if( document.body.clientWidth!=lastWidth ){
      lastWidth = document.body.clientWidth;
      var w = lastWidth*0.5 - 100;
      var allCols = document.querySelectorAll('td.difftxt pre');
      for(let i=0; i<allCols.length; i++){
        allCols[i].style.width = w + "px";
        allCols[i].style.maxWidth = w + "px";
      }
      var allDiffs = document.querySelectorAll('table.diff');
      w = lastWidth;
      for(let i=0; i<allDiffs.length; i++){
        allDiffs[i].style.width = '98%'; // setting to w causes unsightly horiz. scrollbar
        allDiffs[i].style.maxWidth = w + "px";
      }
    }
    setTimeout(checkWidth, 100)
  }
  checkWidth();
})();

Changes to src/diffcmd.c.

183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276

277
278
279



280

281
282
283
284
285
286
287
288
289
290
291
*/
static const char zWebpageHdr[] = 
@ <!DOCTYPE html>
@ <html>
@ <head>
@ <meta charset="UTF-8">
@ <style>
@ table.sbsdiffcols {
@   width: 90%;
@   border-spacing: 0;
@ }
@ table.sbsdiffcols td {
@   padding: 0;
@   vertical-align: top;
@ }
@ table.sbsdiffcols pre {
@   margin: 0;
@   padding: 0;
@   border: 0;
@ }
@ div.difflncol {
@   padding-right: 1em;
@   text-align: right;
@   color: #a0a0a0;
@ }
@ div.difftxtcol {
@   width: 10em;
@   overflow-x: auto;
@ }
@ div.diffmkrcol {
@   padding: 0 1em;
@ }
@ span.diffchng {
@   background-color: #c0c0ff;
@   font-weight: bold;
@ }
@ span.diffadd {
@   background-color: #c0ffc0;
@   font-weight: bold;
@ }
@ span.diffrm {
@   background-color: #ffc8c8;
@   font-weight: bold;
@ }
@ span.diffhr {
@   display: inline-block;
@   margin: .5em 0 1em;
@   color: #0000ff;
@ }
@ span.diffln {
@   color: #a0a0a0;
@ }

@ table.udiff {
@   width: 90%;
@   border-spacing: 0;
@ }
@ pre.udiffln {
@   color: #a0a0a0;
@ }
@ pre.udiffln ins {
@   background-color: #a0e4b2;
@   text-decoration: none;
@ }
@ pre.udiffln del {
@   background-color: #ffc0c0;
@   text-decoration: none;
@ }
@ pre.udifftxt ins {
@   background-color: #dafbe1;
@   text-decoration: none;
@ }
@ pre.udifftxt del {
@   background-color: #ffe8e8;
@   text-decoration: none;
@ }
@ pre.udifftxt ins mark {
@   background-color: #a0e4b2;
@   text-decoration: none;
@   font-weight: bold;
@ }
@ pre.udifftxt del mark {
@   background-color: #ffc0c0;
@   text-decoration: none;
@   font-weight: bold;
@ }
@ h1 {
@   font-size: 150%;
@ }
@
@ table.diff {
@   width: 90%;
@   border-spacing: 0;
@ }
@ td.diffln {

@   text-align: right;
@   padding: 0 0 0 1em;
@ }



@ td.diffsep {

@   padding: 0 0.5em 0 0.5em;
@ }
@ td.difftxt {
@   width: 100%;
@ }
@ td.diffln ins {
@   background-color: #a0e4b2;
@   text-decoration: none;
@ }
@ td.diffln del {
@   background-color: #ffc0c0;







<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>
|
|


|
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<


>

|

>
>
>

>
|

|
|







183
184
185
186
187
188
189



190























191
192
















193
194
195
196
197
198
199
200






























201
202

203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
*/
static const char zWebpageHdr[] = 
@ <!DOCTYPE html>
@ <html>
@ <head>
@ <meta charset="UTF-8">
@ <style>



@ h1 {























@   font-size: 150%;
@ }
















@
@ table.diff {
@   width: 98%;
@   border-spacing: 0;
@ }
@ table.diff td {
@   vertical-align: top;
@ }






























@ table.diff pre {
@   margin: 0 0 0 0;

@ }
@ td.diffln {
@   width: 1px;
@   text-align: right;
@   padding: 0 1em 0 0;
@ }
@ td.difflne {
@   padding-bottom: 0.4em;
@ }
@ td.diffsep {
@   width: 1px;
@   padding: 0 0.3em 0 1em;
@ }
@ td.difftxt pre {
@   overflow-x: auto;
@ }
@ td.diffln ins {
@   background-color: #a0e4b2;
@   text-decoration: none;
@ }
@ td.diffln del {
@   background-color: #ffc0c0;
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
** For --browser, close the connection to the temporary file, then
** launch a web browser to view the file.  After a delay
** of FOSSIL_BROWSER_DIFF_DELAY milliseconds, delete the temp file.
*/
void diff_end(u64 diffFlags, int nErr){
  if( (diffFlags & DIFF_WEBPAGE)!=0 ){
    if( diffFlags & DIFF_SIDEBYSIDE ){
      const unsigned char *zJs = builtin_file("sbsdiff.js", 0);
      fossil_print("<script>\n%s</script>\n", zJs);
    }
    fossil_print("%s", zWebpageEnd);
  }
  if( (diffFlags & DIFF_BROWSER)!=0 && nErr==0 ){
    char *zCmd = mprintf("%s %$", fossil_web_browser(), tempDiffFilename);
    fclose(diffOut);







|







332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
** For --browser, close the connection to the temporary file, then
** launch a web browser to view the file.  After a delay
** of FOSSIL_BROWSER_DIFF_DELAY milliseconds, delete the temp file.
*/
void diff_end(u64 diffFlags, int nErr){
  if( (diffFlags & DIFF_WEBPAGE)!=0 ){
    if( diffFlags & DIFF_SIDEBYSIDE ){
      const unsigned char *zJs = builtin_file("diff.js", 0);
      fossil_print("<script>\n%s</script>\n", zJs);
    }
    fossil_print("%s", zWebpageEnd);
  }
  if( (diffFlags & DIFF_BROWSER)!=0 && nErr==0 ){
    char *zCmd = mprintf("%s %$", fossil_web_browser(), tempDiffFilename);
    fclose(diffOut);
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
    }else if( pToFile==0 ){
      cmp = -1;
    }else{
      cmp = fossil_strcmp(pFromFile->zName, pToFile->zName);
    }
    if( cmp<0 ){
      if( file_dir_match(pFileDir, pFromFile->zName) ){
        if( (diffFlags & DIFF_NUMSTAT)==0 ){
          fossil_print("DELETED %s\n", pFromFile->zName);
        }
        if( asNewFlag ){
          diff_manifest_entry(pFromFile, 0, zDiffCmd, zBinGlob,
                              fIncludeBinary, diffFlags);
        }
      }
      pFromFile = manifest_file_next(pFrom,0);
    }else if( cmp>0 ){
      if( file_dir_match(pFileDir, pToFile->zName) ){
        if( (diffFlags & DIFF_NUMSTAT)==0 ){
          fossil_print("ADDED   %s\n", pToFile->zName);
        }
        if( asNewFlag ){
          diff_manifest_entry(0, pToFile, zDiffCmd, zBinGlob,
                              fIncludeBinary, diffFlags);
        }
      }







|










|







833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
    }else if( pToFile==0 ){
      cmp = -1;
    }else{
      cmp = fossil_strcmp(pFromFile->zName, pToFile->zName);
    }
    if( cmp<0 ){
      if( file_dir_match(pFileDir, pFromFile->zName) ){
        if( (diffFlags & (DIFF_NUMSTAT|DIFF_HTML))==0 ){
          fossil_print("DELETED %s\n", pFromFile->zName);
        }
        if( asNewFlag ){
          diff_manifest_entry(pFromFile, 0, zDiffCmd, zBinGlob,
                              fIncludeBinary, diffFlags);
        }
      }
      pFromFile = manifest_file_next(pFrom,0);
    }else if( cmp>0 ){
      if( file_dir_match(pFileDir, pToFile->zName) ){
        if( (diffFlags & (DIFF_NUMSTAT|DIFF_HTML))==0 ){
          fossil_print("ADDED   %s\n", pToFile->zName);
        }
        if( asNewFlag ){
          diff_manifest_entry(0, pToFile, zDiffCmd, zBinGlob,
                              fIncludeBinary, diffFlags);
        }
      }

Changes to src/main.mk.

216
217
218
219
220
221
222

223
224
225
226
227
228
229
  $(SRCDIR)/alerts/bflat3.wav \
  $(SRCDIR)/alerts/bloop.wav \
  $(SRCDIR)/alerts/plunk.wav \
  $(SRCDIR)/chat.js \
  $(SRCDIR)/ci_edit.js \
  $(SRCDIR)/copybtn.js \
  $(SRCDIR)/default.css \

  $(SRCDIR)/diff.tcl \
  $(SRCDIR)/forum.js \
  $(SRCDIR)/fossil.bootstrap.js \
  $(SRCDIR)/fossil.confirmer.js \
  $(SRCDIR)/fossil.copybutton.js \
  $(SRCDIR)/fossil.dom.js \
  $(SRCDIR)/fossil.fetch.js \







>







216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
  $(SRCDIR)/alerts/bflat3.wav \
  $(SRCDIR)/alerts/bloop.wav \
  $(SRCDIR)/alerts/plunk.wav \
  $(SRCDIR)/chat.js \
  $(SRCDIR)/ci_edit.js \
  $(SRCDIR)/copybtn.js \
  $(SRCDIR)/default.css \
  $(SRCDIR)/diff.js \
  $(SRCDIR)/diff.tcl \
  $(SRCDIR)/forum.js \
  $(SRCDIR)/fossil.bootstrap.js \
  $(SRCDIR)/fossil.confirmer.js \
  $(SRCDIR)/fossil.copybutton.js \
  $(SRCDIR)/fossil.dom.js \
  $(SRCDIR)/fossil.fetch.js \

Changes to win/Makefile.mingw.

625
626
627
628
629
630
631

632
633
634
635
636
637
638
  $(SRCDIR)/alerts/bflat3.wav \
  $(SRCDIR)/alerts/bloop.wav \
  $(SRCDIR)/alerts/plunk.wav \
  $(SRCDIR)/chat.js \
  $(SRCDIR)/ci_edit.js \
  $(SRCDIR)/copybtn.js \
  $(SRCDIR)/default.css \

  $(SRCDIR)/diff.tcl \
  $(SRCDIR)/forum.js \
  $(SRCDIR)/fossil.bootstrap.js \
  $(SRCDIR)/fossil.confirmer.js \
  $(SRCDIR)/fossil.copybutton.js \
  $(SRCDIR)/fossil.dom.js \
  $(SRCDIR)/fossil.fetch.js \







>







625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
  $(SRCDIR)/alerts/bflat3.wav \
  $(SRCDIR)/alerts/bloop.wav \
  $(SRCDIR)/alerts/plunk.wav \
  $(SRCDIR)/chat.js \
  $(SRCDIR)/ci_edit.js \
  $(SRCDIR)/copybtn.js \
  $(SRCDIR)/default.css \
  $(SRCDIR)/diff.js \
  $(SRCDIR)/diff.tcl \
  $(SRCDIR)/forum.js \
  $(SRCDIR)/fossil.bootstrap.js \
  $(SRCDIR)/fossil.confirmer.js \
  $(SRCDIR)/fossil.copybutton.js \
  $(SRCDIR)/fossil.dom.js \
  $(SRCDIR)/fossil.fetch.js \

Changes to win/Makefile.msc.

567
568
569
570
571
572
573

574
575
576
577
578
579
580
        "$(SRCDIR)\alerts\bflat3.wav" \
        "$(SRCDIR)\alerts\bloop.wav" \
        "$(SRCDIR)\alerts\plunk.wav" \
        "$(SRCDIR)\chat.js" \
        "$(SRCDIR)\ci_edit.js" \
        "$(SRCDIR)\copybtn.js" \
        "$(SRCDIR)\default.css" \

        "$(SRCDIR)\diff.tcl" \
        "$(SRCDIR)\forum.js" \
        "$(SRCDIR)\fossil.bootstrap.js" \
        "$(SRCDIR)\fossil.confirmer.js" \
        "$(SRCDIR)\fossil.copybutton.js" \
        "$(SRCDIR)\fossil.dom.js" \
        "$(SRCDIR)\fossil.fetch.js" \







>







567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
        "$(SRCDIR)\alerts\bflat3.wav" \
        "$(SRCDIR)\alerts\bloop.wav" \
        "$(SRCDIR)\alerts\plunk.wav" \
        "$(SRCDIR)\chat.js" \
        "$(SRCDIR)\ci_edit.js" \
        "$(SRCDIR)\copybtn.js" \
        "$(SRCDIR)\default.css" \
        "$(SRCDIR)\diff.js" \
        "$(SRCDIR)\diff.tcl" \
        "$(SRCDIR)\forum.js" \
        "$(SRCDIR)\fossil.bootstrap.js" \
        "$(SRCDIR)\fossil.confirmer.js" \
        "$(SRCDIR)\fossil.copybutton.js" \
        "$(SRCDIR)\fossil.dom.js" \
        "$(SRCDIR)\fossil.fetch.js" \
1175
1176
1177
1178
1179
1180
1181

1182
1183
1184
1185
1186
1187
1188
	echo "$(SRCDIR)\alerts/bflat3.wav" >> $@
	echo "$(SRCDIR)\alerts/bloop.wav" >> $@
	echo "$(SRCDIR)\alerts/plunk.wav" >> $@
	echo "$(SRCDIR)\chat.js" >> $@
	echo "$(SRCDIR)\ci_edit.js" >> $@
	echo "$(SRCDIR)\copybtn.js" >> $@
	echo "$(SRCDIR)\default.css" >> $@

	echo "$(SRCDIR)\diff.tcl" >> $@
	echo "$(SRCDIR)\forum.js" >> $@
	echo "$(SRCDIR)\fossil.bootstrap.js" >> $@
	echo "$(SRCDIR)\fossil.confirmer.js" >> $@
	echo "$(SRCDIR)\fossil.copybutton.js" >> $@
	echo "$(SRCDIR)\fossil.dom.js" >> $@
	echo "$(SRCDIR)\fossil.fetch.js" >> $@







>







1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
	echo "$(SRCDIR)\alerts/bflat3.wav" >> $@
	echo "$(SRCDIR)\alerts/bloop.wav" >> $@
	echo "$(SRCDIR)\alerts/plunk.wav" >> $@
	echo "$(SRCDIR)\chat.js" >> $@
	echo "$(SRCDIR)\ci_edit.js" >> $@
	echo "$(SRCDIR)\copybtn.js" >> $@
	echo "$(SRCDIR)\default.css" >> $@
	echo "$(SRCDIR)\diff.js" >> $@
	echo "$(SRCDIR)\diff.tcl" >> $@
	echo "$(SRCDIR)\forum.js" >> $@
	echo "$(SRCDIR)\fossil.bootstrap.js" >> $@
	echo "$(SRCDIR)\fossil.confirmer.js" >> $@
	echo "$(SRCDIR)\fossil.copybutton.js" >> $@
	echo "$(SRCDIR)\fossil.dom.js" >> $@
	echo "$(SRCDIR)\fossil.fetch.js" >> $@