Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Draw a thin box around diffs in the default skin (per [forum:/forumpost/a42aade32dd9d42|forum post a42aade32dd9d42]). Show ellipsis at the tops and bottoms of files, if warranted. Fix a problem with "diff.js" that was failing to link all scrollbars associated with a single diff. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | diff-color-enhancements |
| Files: | files | file ages | folders |
| SHA3-256: |
63a5c754fd8d3437e20f7ef0a815ab31 |
| User & Date: | drh 2021-09-03 23:00:50.437 |
Context
|
2021-09-03
| ||
| 23:39 | Add chunk numbers to each row of the diff output for HTML diffs. ... (check-in: 8caab6155e user: drh tags: diff-color-enhancements) | |
| 23:00 | Draw a thin box around diffs in the default skin (per [forum:/forumpost/a42aade32dd9d42|forum post a42aade32dd9d42]). Show ellipsis at the tops and bottoms of files, if warranted. Fix a problem with "diff.js" that was failing to link all scrollbars associated with a single diff. ... (check-in: 63a5c754fd user: drh tags: diff-color-enhancements) | |
| 22:49 | Improved alignment of partial line diffs. More work to be done in this area. Also fix a problem in diff.js that was causing problems when comparing two empty files. ... (check-in: 24d28cb7c9 user: drh tags: diff-color-enhancements) | |
Changes
Changes to src/default.css.
| ︙ | ︙ | |||
532 533 534 535 536 537 538 539 540 541 542 543 544 545 |
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;
}
| > | 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 |
padding-top: 1px;
}
/* Rules governing diff layout and colors */
table.diff {
width: 98%;
border-spacing: 0;
border: 1px solid black;
}
table.diff td {
vertical-align: top;
}
table.diff pre {
margin: 0 0 0 0;
}
|
| ︙ | ︙ |
Changes to src/diff.c.
| ︙ | ︙ | |||
1416 1417 1418 1419 1420 1421 1422 |
if( blob_size(&p->aCol[0])>0 ) return;
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);
| < | | < | 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 |
if( blob_size(&p->aCol[0])>0 ) return;
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);
blob_append(p->pOut, "<tr><td class=\"diffln difflne\">"
"︙</td><td></td><td></td></tr>\n", -1);
p->lnLeft += n;
p->lnRight += n;
}
static void dfunifiedCommon(DiffBuilder *p, const DLine *pLine){
dfunifiedStartRow(p);
dfunifiedFinishDelete(p);
dfunifiedFinishInsert(p);
|
| ︙ | ︙ | |||
1629 1630 1631 1632 1633 1634 1635 |
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);
| < | | | | | < | 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 |
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);
blob_append(p->pOut,
"<tr><td class=\"diffln difflnl difflne\">︙</td>"
"<td></td><td></td>"
"<td class=\"diffln difflnr difflne\">︙</td>"
"<td/td></tr>\n", -1);
p->lnLeft += n;
p->lnRight += n;
}
static void dfsplitCommon(DiffBuilder *p, const DLine *pLine){
dfsplitStartRow(p);
dfsplitChangeState(p, 0);
p->lnLeft++;
|
| ︙ | ︙ |
Changes to src/diff.js.
| ︙ | ︙ | |||
16 17 18 19 20 21 22 |
if(txtPres.length>=2)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';
txtPres[i].onscroll = function(e){
| | | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
if(txtPres.length>=2)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';
txtPres[i].onscroll = function(e){
for(var j=0; j<txtPres.length; j++) txtPres[j].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;
|
| ︙ | ︙ |
Changes to src/diffcmd.c.
| ︙ | ︙ | |||
210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
@ 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;
@ }
| > | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
@ h1 {
@ font-size: 150%;
@ }
@
@ table.diff {
@ width: 98%;
@ border-spacing: 0;
@ border: 1px solid black;
@ }
@ table.diff td {
@ vertical-align: top;
@ }
@ table.diff pre {
@ margin: 0 0 0 0;
@ }
|
| ︙ | ︙ |