Fossil

Check-in [2d8f2b4e]
Login

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

Overview
Comment:Add better comment explaining why .txtA/.txtB lines are padded with spaces.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sbsreloaded
Files: files | file ages | folders
SHA1:2d8f2b4e246ff96896d2b61b9d07086b2cced37c
User & Date: joel 2013-07-09 20:51:46
Context
2013-07-10
05:27
Use tab stops instead of spaces to equalize line lengths in Tk diff. check-in: 695156c1 user: joel tags: sbsreloaded
2013-07-09
20:51
Add better comment explaining why .txtA/.txtB lines are padded with spaces. check-in: 2d8f2b4e user: joel tags: sbsreloaded
11:46
Merge in the latest trunk changes. check-in: d97fe536 user: drh tags: sbsreloaded
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/diffcmd.c.

707
708
709
710
711
712
713
714





715
716
717
718
719
720
721
@     }
@   }
@   
@   foreach c {.lnA .lnB .mkr} {
@     $c config -width $gDiffs($idx,[colType $c]-width)
@   }
@   
@   # Add whitespace to equalize line lengths.





@   regexp {\d+} [.txtA index {end -1c}] numLines
@   set width $gDiffs($idx,txt-width)
@   foreach c {.txtA .txtB} {
@     for {set ln 1} {$ln <= $numLines} {incr ln} {
@       regexp {\d+$} [$c index $ln.end] len
@       $c insert $ln.end [string repeat " " [expr {$width-$len}]] ws
@     }







|
>
>
>
>
>







707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
@     }
@   }
@   
@   foreach c {.lnA .lnB .mkr} {
@     $c config -width $gDiffs($idx,[colType $c]-width)
@   }
@   
@   # Add whitespace to equalize line lengths.  This is done in order to:
@   #  (a) scroll to the same horizontal position on both sides and
@   #  (b) keep the horizontal scrollbars from changing position/size as
@   #      you scroll vertically.
@   # To test, try "fossil diff --tk --from d7afa8f153 --to abe1030ca8"
@   # as well as its inverse.
@   regexp {\d+} [.txtA index {end -1c}] numLines
@   set width $gDiffs($idx,txt-width)
@   foreach c {.txtA .txtB} {
@     for {set ln 1} {$ln <= $numLines} {incr ln} {
@       regexp {\d+$} [$c index $ln.end] len
@       $c insert $ln.end [string repeat " " [expr {$width-$len}]] ws
@     }