Fossil SCM
Add better comment explaining why .txtA/.txtB lines are padded with spaces.
Commit
2d8f2b4e246ff96896d2b61b9d07086b2cced37c
Parent
d97fe536859ea89…
1 file changed
+6
-1
+6
-1
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -709,11 +709,16 @@ | ||
| 709 | 709 | @ |
| 710 | 710 | @ foreach c {.lnA .lnB .mkr} { |
| 711 | 711 | @ $c config -width $gDiffs($idx,[colType $c]-width) |
| 712 | 712 | @ } |
| 713 | 713 | @ |
| 714 | -@ # Add whitespace to equalize line lengths. | |
| 714 | +@ # Add whitespace to equalize line lengths. This is done in order to: | |
| 715 | +@ # (a) scroll to the same horizontal position on both sides and | |
| 716 | +@ # (b) keep the horizontal scrollbars from changing position/size as | |
| 717 | +@ # you scroll vertically. | |
| 718 | +@ # To test, try "fossil diff --tk --from d7afa8f153 --to abe1030ca8" | |
| 719 | +@ # as well as its inverse. | |
| 715 | 720 | @ regexp {\d+} [.txtA index {end -1c}] numLines |
| 716 | 721 | @ set width $gDiffs($idx,txt-width) |
| 717 | 722 | @ foreach c {.txtA .txtB} { |
| 718 | 723 | @ for {set ln 1} {$ln <= $numLines} {incr ln} { |
| 719 | 724 | @ regexp {\d+$} [$c index $ln.end] len |
| 720 | 725 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -709,11 +709,16 @@ | |
| 709 | @ |
| 710 | @ foreach c {.lnA .lnB .mkr} { |
| 711 | @ $c config -width $gDiffs($idx,[colType $c]-width) |
| 712 | @ } |
| 713 | @ |
| 714 | @ # Add whitespace to equalize line lengths. |
| 715 | @ regexp {\d+} [.txtA index {end -1c}] numLines |
| 716 | @ set width $gDiffs($idx,txt-width) |
| 717 | @ foreach c {.txtA .txtB} { |
| 718 | @ for {set ln 1} {$ln <= $numLines} {incr ln} { |
| 719 | @ regexp {\d+$} [$c index $ln.end] len |
| 720 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -709,11 +709,16 @@ | |
| 709 | @ |
| 710 | @ foreach c {.lnA .lnB .mkr} { |
| 711 | @ $c config -width $gDiffs($idx,[colType $c]-width) |
| 712 | @ } |
| 713 | @ |
| 714 | @ # Add whitespace to equalize line lengths. This is done in order to: |
| 715 | @ # (a) scroll to the same horizontal position on both sides and |
| 716 | @ # (b) keep the horizontal scrollbars from changing position/size as |
| 717 | @ # you scroll vertically. |
| 718 | @ # To test, try "fossil diff --tk --from d7afa8f153 --to abe1030ca8" |
| 719 | @ # as well as its inverse. |
| 720 | @ regexp {\d+} [.txtA index {end -1c}] numLines |
| 721 | @ set width $gDiffs($idx,txt-width) |
| 722 | @ foreach c {.txtA .txtB} { |
| 723 | @ for {set ln 1} {$ln <= $numLines} {incr ln} { |
| 724 | @ regexp {\d+$} [$c index $ln.end] len |
| 725 |