aboutsummaryrefslogtreecommitdiffstats
path: root/termui
diff options
context:
space:
mode:
Diffstat (limited to 'termui')
-rw-r--r--termui/show_bug.go9
-rw-r--r--termui/termui.go8
2 files changed, 8 insertions, 9 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go
index 68a46a31..d25d21db 100644
--- a/termui/show_bug.go
+++ b/termui/show_bug.go
@@ -8,7 +8,6 @@ import (
"github.com/MichaelMure/git-bug/bug"
"github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/util/colors"
- "github.com/MichaelMure/git-bug/util/git"
"github.com/MichaelMure/git-bug/util/text"
"github.com/MichaelMure/gocui"
)
@@ -232,7 +231,7 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error {
y0 += lines + 1
for _, op := range snap.Timeline {
- viewName := op.Hash().String()
+ viewName := op.ID()
// 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
@@ -643,7 +642,7 @@ func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error {
return nil
}
- op, err := snap.SearchTimelineItem(git.Hash(sb.selected))
+ op, err := snap.SearchTimelineItem(sb.selected)
if err != nil {
return err
}
@@ -651,10 +650,10 @@ func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error {
switch op.(type) {
case *bug.AddCommentTimelineItem:
message := op.(*bug.AddCommentTimelineItem).Message
- return editCommentWithEditor(sb.bug, op.Hash(), message)
+ return editCommentWithEditor(sb.bug, op.ID(), message)
case *bug.CreateTimelineItem:
preMessage := op.(*bug.CreateTimelineItem).Message
- return editCommentWithEditor(sb.bug, op.Hash(), preMessage)
+ return editCommentWithEditor(sb.bug, op.ID(), preMessage)
case *bug.LabelChangeTimelineItem:
return sb.editLabels(g, snap)
}
diff --git a/termui/termui.go b/termui/termui.go
index 46f9dd06..2a0b64e9 100644
--- a/termui/termui.go
+++ b/termui/termui.go
@@ -2,11 +2,11 @@
package termui
import (
- "github.com/MichaelMure/git-bug/cache"
- "github.com/MichaelMure/git-bug/input"
- "github.com/MichaelMure/git-bug/util/git"
"github.com/MichaelMure/gocui"
"github.com/pkg/errors"
+
+ "github.com/MichaelMure/git-bug/cache"
+ "github.com/MichaelMure/git-bug/input"
)
var errTerminateMainloop = errors.New("terminate gocui mainloop")
@@ -237,7 +237,7 @@ func addCommentWithEditor(bug *cache.BugCache) error {
return errTerminateMainloop
}
-func editCommentWithEditor(bug *cache.BugCache, target git.Hash, preMessage string) error {
+func editCommentWithEditor(bug *cache.BugCache, target string, preMessage string) error {
// This is somewhat hacky.
// As there is no way to pause gocui, run the editor and restart gocui,
// we have to stop it entirely and start a new one later.