Code

git-gui: Clip the commit summaries in the blame history menu
authorShawn O. Pearce <spearce@spearce.org>
Sat, 2 Jun 2007 04:09:55 +0000 (00:09 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 6 Jun 2007 05:26:48 +0000 (01:26 -0400)
Some commit lines can get really long when users enter a lot of
text without linewrapping (for example).  Rather than letting the
menu get out of control in terms of width we clip the summary to
the first 50+ characters.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/blame.tcl

index 2f7503ad6b099f0b0938aa44d5c94a2f63eddc40..85e9e0dc32e08361a755bea65811274cff984d39 100644 (file)
@@ -390,6 +390,9 @@ method _history_menu {} {
                }
                if {![catch {set summary $header($c,summary)}]} {
                        append t " $summary"
+                       if {[string length $t] > 70} {
+                               set t [string range $t 0 66]...
+                       }
                }
 
                $m add command -label $t -command [cb _goback $i $c $f]