From: Pat Thoyts Date: Tue, 11 Oct 2011 13:57:24 +0000 (+0100) Subject: gitk: display line numbers for file view X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fpt%2Flinenumbers;p=gitk gitk: display line numbers for file view Suggested-by: Sebastian Schuberth Signed-off-by: Pat Thoyts --- diff --git a/gitk b/gitk index a701e0d..c801993 100755 --- a/gitk +++ b/gitk @@ -2271,6 +2271,9 @@ proc makewindow {} { if {$have_tk85} { $ctext conf -tabstyle wordprocessor } + catch {eval font create linenofont [font configure textfont] \ + -size [expr {[font configure textfont -size] - 2}]} + $ctext tag configure lineno -foreground #808080 -font linenofont ${NS}::scrollbar .bleft.bottom.sb -command "$ctext yview" ${NS}::scrollbar .bleft.bottom.sbhorizontal -command "$ctext xview" -orient h pack .bleft.top -side top -fill x @@ -7333,7 +7336,7 @@ proc getblobline {bf id} { $ctext config -state normal set nl 0 while {[incr nl] <= 1000 && [gets $bf line] >= 0} { - $ctext insert end "$line\n" + $ctext insert end $nl lineno "\t" {} "$line\n" } if {[eof $bf]} { global jump_to_here ctext_file_names commentend