gitk: Avoid Tcl error when switching views
authorPaul Mackerras <paulus@samba.org>
Tue, 11 Mar 2008 11:11:19 +0000 (22:11 +1100)
committerPaul Mackerras <paulus@samba.org>
Tue, 11 Mar 2008 11:11:19 +0000 (22:11 +1100)
commit494d3b8a6c93d88daf4a52dbcc6ab07903f8ed4e
tree9f1aa0e61f13c52d3dfe62a4f9c7db80e8676475
parentcb8329aa9a6cc2e009d552b1180ce107cec4eb9d
gitk: Avoid Tcl error when switching views

Michele Ballabio <barra_cuda@katamail.com> pointed out that gitk
sometimes throws a Tcl error (can't read "yscreen") when switching
views, and proposed a patch.  This is a different way of fixing it
which is a bit neater.  Basically, in showview we only set yscreen if
the selected commit is on screen to start with, and then we only
scroll the canvas to bring it onscreen if yscreen is set and the
same commit exists in the new view.

Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk