From e47c07681c6ddb458028a553ec3cb306b2e97e37 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Thu, 4 Oct 2018 10:30:56 -0600 Subject: Use operation hash for view name This change allows the operation to be found given only the view name. --- termui/show_bug.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/termui/show_bug.go b/termui/show_bug.go index 4ca987bd..aa52c8a3 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -9,6 +9,7 @@ import ( "github.com/MichaelMure/git-bug/cache" "github.com/MichaelMure/git-bug/util/colors" "github.com/MichaelMure/git-bug/util/text" + "github.com/MichaelMure/git-bug/util/git" "github.com/jroimartin/gocui" ) @@ -240,8 +241,8 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error { fmt.Fprint(v, bugHeader) y0 += lines + 1 - for i, op := range snap.Timeline { - viewName := fmt.Sprintf("op%d", i) + for _, op := range snap.Timeline { + viewName := op.Hash().String() // TODO: me might skip the rendering of blocks that are outside of the view // but to do that we need to rework how sb.mainSelectableView is maintained -- cgit