gitk: display line numbers for file view pt/linenumbers
authorPat Thoyts <patthoyts@users.sourceforge.net>
Tue, 11 Oct 2011 13:57:24 +0000 (14:57 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Tue, 13 Dec 2011 22:47:58 +0000 (22:47 +0000)
Suggested-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
gitk

diff --git a/gitk b/gitk
index a701e0d1a5221e5e4653bf124227b297af41695b..c8019933586907902674bf97854674e41b7f84b0 100755 (executable)
--- 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