Fossil SCM

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.

drh 2021-09-03 23:00 diff-color-enhancements
Commit 63a5c754fd8d3437e20f7ef0a815ab31aecadc191ed54e5aa64b6be02f238d4f
--- src/default.css
+++ src/default.css
@@ -534,10 +534,11 @@
534534
535535
/* Rules governing diff layout and colors */
536536
table.diff {
537537
width: 98%;
538538
border-spacing: 0;
539
+ border: 1px solid black;
539540
}
540541
table.diff td {
541542
vertical-align: top;
542543
}
543544
table.diff pre {
544545
--- src/default.css
+++ src/default.css
@@ -534,10 +534,11 @@
534
535 /* Rules governing diff layout and colors */
536 table.diff {
537 width: 98%;
538 border-spacing: 0;
 
539 }
540 table.diff td {
541 vertical-align: top;
542 }
543 table.diff pre {
544
--- src/default.css
+++ src/default.css
@@ -534,10 +534,11 @@
534
535 /* Rules governing diff layout and colors */
536 table.diff {
537 width: 98%;
538 border-spacing: 0;
539 border: 1px solid black;
540 }
541 table.diff td {
542 vertical-align: top;
543 }
544 table.diff pre {
545
+7 -11
--- src/diff.c
+++ src/diff.c
@@ -1418,14 +1418,12 @@
14181418
p->eState = 0;
14191419
p->nPending = 0;
14201420
}
14211421
static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
14221422
dfunifiedFinishRow(p);
1423
- if( (p->lnLeft || p->lnRight) && !isFinal ){
1424
- blob_append(p->pOut, "<tr><td class=\"diffln difflne\">"
1425
- "&#xfe19;</td><td></td><td></td></tr>\n", -1);
1426
- }
1423
+ blob_append(p->pOut, "<tr><td class=\"diffln difflne\">"
1424
+ "&#xfe19;</td><td></td><td></td></tr>\n", -1);
14271425
p->lnLeft += n;
14281426
p->lnRight += n;
14291427
}
14301428
static void dfunifiedCommon(DiffBuilder *p, const DLine *pLine){
14311429
dfunifiedStartRow(p);
@@ -1631,17 +1629,15 @@
16311629
blob_append(p->pOut,"<tr><td class=\"diffln difflnl\"><pre>\n", -1);
16321630
p->eState = 0;
16331631
}
16341632
static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
16351633
dfsplitFinishRow(p);
1636
- if( (p->lnLeft || p->lnRight) && !isFinal ){
1637
- blob_append(p->pOut,
1638
- "<tr><td class=\"diffln difflnl difflne\">&#xfe19;</td>"
1639
- "<td></td><td></td>"
1640
- "<td class=\"diffln difflnr difflne\">&#xfe19;</td>"
1641
- "<td/td></tr>\n", -1);
1642
- }
1634
+ blob_append(p->pOut,
1635
+ "<tr><td class=\"diffln difflnl difflne\">&#xfe19;</td>"
1636
+ "<td></td><td></td>"
1637
+ "<td class=\"diffln difflnr difflne\">&#xfe19;</td>"
1638
+ "<td/td></tr>\n", -1);
16431639
p->lnLeft += n;
16441640
p->lnRight += n;
16451641
}
16461642
static void dfsplitCommon(DiffBuilder *p, const DLine *pLine){
16471643
dfsplitStartRow(p);
16481644
--- src/diff.c
+++ src/diff.c
@@ -1418,14 +1418,12 @@
1418 p->eState = 0;
1419 p->nPending = 0;
1420 }
1421 static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
1422 dfunifiedFinishRow(p);
1423 if( (p->lnLeft || p->lnRight) && !isFinal ){
1424 blob_append(p->pOut, "<tr><td class=\"diffln difflne\">"
1425 "&#xfe19;</td><td></td><td></td></tr>\n", -1);
1426 }
1427 p->lnLeft += n;
1428 p->lnRight += n;
1429 }
1430 static void dfunifiedCommon(DiffBuilder *p, const DLine *pLine){
1431 dfunifiedStartRow(p);
@@ -1631,17 +1629,15 @@
1631 blob_append(p->pOut,"<tr><td class=\"diffln difflnl\"><pre>\n", -1);
1632 p->eState = 0;
1633 }
1634 static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
1635 dfsplitFinishRow(p);
1636 if( (p->lnLeft || p->lnRight) && !isFinal ){
1637 blob_append(p->pOut,
1638 "<tr><td class=\"diffln difflnl difflne\">&#xfe19;</td>"
1639 "<td></td><td></td>"
1640 "<td class=\"diffln difflnr difflne\">&#xfe19;</td>"
1641 "<td/td></tr>\n", -1);
1642 }
1643 p->lnLeft += n;
1644 p->lnRight += n;
1645 }
1646 static void dfsplitCommon(DiffBuilder *p, const DLine *pLine){
1647 dfsplitStartRow(p);
1648
--- src/diff.c
+++ src/diff.c
@@ -1418,14 +1418,12 @@
1418 p->eState = 0;
1419 p->nPending = 0;
1420 }
1421 static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
1422 dfunifiedFinishRow(p);
1423 blob_append(p->pOut, "<tr><td class=\"diffln difflne\">"
1424 "&#xfe19;</td><td></td><td></td></tr>\n", -1);
 
 
1425 p->lnLeft += n;
1426 p->lnRight += n;
1427 }
1428 static void dfunifiedCommon(DiffBuilder *p, const DLine *pLine){
1429 dfunifiedStartRow(p);
@@ -1631,17 +1629,15 @@
1629 blob_append(p->pOut,"<tr><td class=\"diffln difflnl\"><pre>\n", -1);
1630 p->eState = 0;
1631 }
1632 static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
1633 dfsplitFinishRow(p);
1634 blob_append(p->pOut,
1635 "<tr><td class=\"diffln difflnl difflne\">&#xfe19;</td>"
1636 "<td></td><td></td>"
1637 "<td class=\"diffln difflnr difflne\">&#xfe19;</td>"
1638 "<td/td></tr>\n", -1);
 
 
1639 p->lnLeft += n;
1640 p->lnRight += n;
1641 }
1642 static void dfsplitCommon(DiffBuilder *p, const DLine *pLine){
1643 dfsplitStartRow(p);
1644
+1 -1
--- src/diff.js
+++ src/diff.js
@@ -18,11 +18,11 @@
1818
for(i=0; i<txtCols.length; i++){
1919
txtCols[i].style.width = width + 'px';
2020
txtPres[i].style.maxWidth = width + 'px';
2121
txtPres[i].style.width = width + 'px';
2222
txtPres[i].onscroll = function(e){
23
- txtPres[0].scrollLeft = txtPres[1].scrollLeft = this.scrollLeft;
23
+ for(var j=0; j<txtPres.length; j++) txtPres[j].scrollLeft = this.scrollLeft;
2424
};
2525
}
2626
diff.tabIndex = 0;
2727
diff.onkeydown = function(e){
2828
e = e || event;
2929
--- src/diff.js
+++ src/diff.js
@@ -18,11 +18,11 @@
18 for(i=0; i<txtCols.length; i++){
19 txtCols[i].style.width = width + 'px';
20 txtPres[i].style.maxWidth = width + 'px';
21 txtPres[i].style.width = width + 'px';
22 txtPres[i].onscroll = function(e){
23 txtPres[0].scrollLeft = txtPres[1].scrollLeft = this.scrollLeft;
24 };
25 }
26 diff.tabIndex = 0;
27 diff.onkeydown = function(e){
28 e = e || event;
29
--- src/diff.js
+++ src/diff.js
@@ -18,11 +18,11 @@
18 for(i=0; i<txtCols.length; i++){
19 txtCols[i].style.width = width + 'px';
20 txtPres[i].style.maxWidth = width + 'px';
21 txtPres[i].style.width = width + 'px';
22 txtPres[i].onscroll = function(e){
23 for(var j=0; j<txtPres.length; j++) txtPres[j].scrollLeft = this.scrollLeft;
24 };
25 }
26 diff.tabIndex = 0;
27 diff.onkeydown = function(e){
28 e = e || event;
29
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -212,10 +212,11 @@
212212
@ }
213213
@
214214
@ table.diff {
215215
@ width: 98%;
216216
@ border-spacing: 0;
217
+@ border: 1px solid black;
217218
@ }
218219
@ table.diff td {
219220
@ vertical-align: top;
220221
@ }
221222
@ table.diff pre {
222223
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -212,10 +212,11 @@
212 @ }
213 @
214 @ table.diff {
215 @ width: 98%;
216 @ border-spacing: 0;
 
217 @ }
218 @ table.diff td {
219 @ vertical-align: top;
220 @ }
221 @ table.diff pre {
222
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -212,10 +212,11 @@
212 @ }
213 @
214 @ table.diff {
215 @ width: 98%;
216 @ border-spacing: 0;
217 @ border: 1px solid black;
218 @ }
219 @ table.diff td {
220 @ vertical-align: top;
221 @ }
222 @ table.diff pre {
223

Keyboard Shortcuts

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