Fossil SCM
Do not pad lines of the Tk diff view with spaces.
Commit
0a869bebc24f689b725f780b0036d76ab90c666d
Parent
d97fe536859ea89…
1 file changed
-25
-25
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -709,20 +709,10 @@ | ||
| 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. | |
| 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 | -@ $c insert $ln.end [string repeat " " [expr {$width-$len}]] ws | |
| 721 | -@ } | |
| 722 | -@ } | |
| 723 | -@ | |
| 724 | 714 | @ foreach c [cols] { |
| 725 | 715 | @ $c config -state disabled |
| 726 | 716 | @ } |
| 727 | 717 | @ } |
| 728 | 718 | @ |
| @@ -743,23 +733,10 @@ | ||
| 743 | 733 | @ $sb set $first $last |
| 744 | 734 | @ } |
| 745 | 735 | @ } |
| 746 | 736 | @ } |
| 747 | 737 | @ |
| 748 | -@ proc copyText {c} { | |
| 749 | -@ set txt "" | |
| 750 | -@ # Copy selection without excess trailing whitespace | |
| 751 | -@ $c tag config ws -elide 1 | |
| 752 | -@ catch { | |
| 753 | -@ $c tag add sel sel.first sel.last | |
| 754 | -@ set txt [selection get] | |
| 755 | -@ } | |
| 756 | -@ $c tag config ws -elide 0 | |
| 757 | -@ clipboard clear | |
| 758 | -@ clipboard append $txt | |
| 759 | -@ } | |
| 760 | -@ | |
| 761 | 738 | @ wm withdraw . |
| 762 | 739 | @ wm title . $CFG(TITLE) |
| 763 | 740 | @ wm iconname . $CFG(TITLE) |
| 764 | 741 | @ bind . <q> exit |
| 765 | 742 | @ bind . <Tab> {cycleDiffs; break} |
| @@ -801,12 +778,10 @@ | ||
| 801 | 778 | @ -xscroll {scrollSync x {.sbxA .sbxB}} |
| 802 | 779 | @ foreach tag {add rm chng} { |
| 803 | 780 | @ $txt tag config $tag -background $CFG([string toupper $tag]_BG) |
| 804 | 781 | @ $txt tag lower $tag |
| 805 | 782 | @ } |
| 806 | -@ bind $txt <<Copy>> {copyText %W; break} | |
| 807 | -@ bind $txt <<Cut>> {copyText %W; break} | |
| 808 | 783 | @ } |
| 809 | 784 | @ text .mkr |
| 810 | 785 | @ |
| 811 | 786 | @ font create mono -family courier -size $CFG(FONT_SIZE) |
| 812 | 787 | @ foreach font $CFG(FONTS) { |
| 813 | 788 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -709,20 +709,10 @@ | |
| 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 | @ $c insert $ln.end [string repeat " " [expr {$width-$len}]] ws |
| 721 | @ } |
| 722 | @ } |
| 723 | @ |
| 724 | @ foreach c [cols] { |
| 725 | @ $c config -state disabled |
| 726 | @ } |
| 727 | @ } |
| 728 | @ |
| @@ -743,23 +733,10 @@ | |
| 743 | @ $sb set $first $last |
| 744 | @ } |
| 745 | @ } |
| 746 | @ } |
| 747 | @ |
| 748 | @ proc copyText {c} { |
| 749 | @ set txt "" |
| 750 | @ # Copy selection without excess trailing whitespace |
| 751 | @ $c tag config ws -elide 1 |
| 752 | @ catch { |
| 753 | @ $c tag add sel sel.first sel.last |
| 754 | @ set txt [selection get] |
| 755 | @ } |
| 756 | @ $c tag config ws -elide 0 |
| 757 | @ clipboard clear |
| 758 | @ clipboard append $txt |
| 759 | @ } |
| 760 | @ |
| 761 | @ wm withdraw . |
| 762 | @ wm title . $CFG(TITLE) |
| 763 | @ wm iconname . $CFG(TITLE) |
| 764 | @ bind . <q> exit |
| 765 | @ bind . <Tab> {cycleDiffs; break} |
| @@ -801,12 +778,10 @@ | |
| 801 | @ -xscroll {scrollSync x {.sbxA .sbxB}} |
| 802 | @ foreach tag {add rm chng} { |
| 803 | @ $txt tag config $tag -background $CFG([string toupper $tag]_BG) |
| 804 | @ $txt tag lower $tag |
| 805 | @ } |
| 806 | @ bind $txt <<Copy>> {copyText %W; break} |
| 807 | @ bind $txt <<Cut>> {copyText %W; break} |
| 808 | @ } |
| 809 | @ text .mkr |
| 810 | @ |
| 811 | @ font create mono -family courier -size $CFG(FONT_SIZE) |
| 812 | @ foreach font $CFG(FONTS) { |
| 813 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -709,20 +709,10 @@ | |
| 709 | @ |
| 710 | @ foreach c {.lnA .lnB .mkr} { |
| 711 | @ $c config -width $gDiffs($idx,[colType $c]-width) |
| 712 | @ } |
| 713 | @ |
| 714 | @ foreach c [cols] { |
| 715 | @ $c config -state disabled |
| 716 | @ } |
| 717 | @ } |
| 718 | @ |
| @@ -743,23 +733,10 @@ | |
| 733 | @ $sb set $first $last |
| 734 | @ } |
| 735 | @ } |
| 736 | @ } |
| 737 | @ |
| 738 | @ wm withdraw . |
| 739 | @ wm title . $CFG(TITLE) |
| 740 | @ wm iconname . $CFG(TITLE) |
| 741 | @ bind . <q> exit |
| 742 | @ bind . <Tab> {cycleDiffs; break} |
| @@ -801,12 +778,10 @@ | |
| 778 | @ -xscroll {scrollSync x {.sbxA .sbxB}} |
| 779 | @ foreach tag {add rm chng} { |
| 780 | @ $txt tag config $tag -background $CFG([string toupper $tag]_BG) |
| 781 | @ $txt tag lower $tag |
| 782 | @ } |
| 783 | @ } |
| 784 | @ text .mkr |
| 785 | @ |
| 786 | @ font create mono -family courier -size $CFG(FONT_SIZE) |
| 787 | @ foreach font $CFG(FONTS) { |
| 788 |