Skip to content

Commit 9922c5a

Browse files
marcnarcpaulusmack
authored andcommitted
gitk: Show the current view's name in the window title
If the current view is the "Command line" view, show the command line arguments instead of the view name. Signed-off-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 427cf16 commit 9922c5a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

gitk

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4036,6 +4036,19 @@ proc shellsplit {str} {
40364036
return $l
40374037
}
40384038

4039+
proc set_window_title {} {
4040+
global appname curview viewname vrevs
4041+
set rev [mc "All files"]
4042+
if {$curview ne 0} {
4043+
if {$viewname($curview) eq [mc "Command line"]} {
4044+
set rev [string map {"--gitk-symmetric-diff-marker" "--merge"} $vrevs($curview)]
4045+
} else {
4046+
set rev $viewname($curview)
4047+
}
4048+
}
4049+
wm title . "[reponame]: $rev - $appname"
4050+
}
4051+
40394052
# Code to implement multiple views
40404053

40414054
proc newview {ishighlight} {
@@ -4512,6 +4525,7 @@ proc showview {n} {
45124525
} elseif {$numcommits == 0} {
45134526
show_status [mc "No commits selected"]
45144527
}
4528+
set_window_title
45154529
}
45164530

45174531
# Stuff relating to the highlighting facility
@@ -6652,6 +6666,7 @@ proc show_status {msg} {
66526666
global canv fgcolor
66536667

66546668
clear_display
6669+
set_window_title
66556670
$canv create text 3 3 -anchor nw -text $msg -font mainfont \
66566671
-tags text -fill $fgcolor
66576672
}
@@ -12403,7 +12418,7 @@ catch {
1240312418
}
1240412419
# wait for the window to become visible
1240512420
tkwait visibility .
12406-
wm title . "[reponame] - $appname"
12421+
set_window_title
1240712422
update
1240812423
readrefs
1240912424

0 commit comments

Comments
 (0)