diff options
Diffstat (limited to 'termui')
-rw-r--r-- | termui/bug_table.go | 6 | ||||
-rw-r--r-- | termui/show_bug.go | 11 | ||||
-rw-r--r-- | termui/termui.go | 3 |
3 files changed, 11 insertions, 9 deletions
diff --git a/termui/bug_table.go b/termui/bug_table.go index 4293a3c2..8d69d665 100644 --- a/termui/bug_table.go +++ b/termui/bug_table.go @@ -25,7 +25,7 @@ type bugTable struct { repo *cache.RepoCache queryStr string query *cache.Query - allIds []string + allIds []entity.Id excerpts []*cache.BugExcerpt pageCursor int selectCursor int @@ -308,7 +308,7 @@ func (bt *bugTable) render(v *gocui.View, maxX int) { lastEditTime := time.Unix(excerpt.EditUnixTime, 0) - id := text.LeftPadMaxLine(excerpt.HumanId(), columnWidths["id"], 1) + id := text.LeftPadMaxLine(excerpt.Id.Human(), columnWidths["id"], 1) status := text.LeftPadMaxLine(excerpt.Status.String(), columnWidths["status"], 1) title := text.LeftPadMaxLine(excerpt.Title, columnWidths["title"], 1) author := text.LeftPadMaxLine(authorDisplayName, columnWidths["author"], 1) @@ -482,7 +482,7 @@ func (bt *bugTable) pull(g *gocui.Gui, v *gocui.View) error { }) } else { _, _ = fmt.Fprintf(&buffer, "%s%s: %s", - beginLine, colors.Cyan(result.Entity.HumanId()), result, + beginLine, colors.Cyan(result.Entity.Id().Human()), result, ) beginLine = "\n" diff --git a/termui/show_bug.go b/termui/show_bug.go index d25d21db..228b85b0 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -7,6 +7,7 @@ import ( "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/cache" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/util/colors" "github.com/MichaelMure/git-bug/util/text" "github.com/MichaelMure/gocui" @@ -213,7 +214,7 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error { } bugHeader := fmt.Sprintf("[%s] %s\n\n[%s] %s opened this bug on %s%s", - colors.Cyan(snap.HumanId()), + colors.Cyan(snap.Id().Human()), colors.Bold(snap.Title), colors.Yellow(snap.Status), colors.Magenta(snap.Author.DisplayName()), @@ -231,7 +232,7 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error { y0 += lines + 1 for _, op := range snap.Timeline { - viewName := op.ID() + viewName := op.Id().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 @@ -642,7 +643,7 @@ func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error { return nil } - op, err := snap.SearchTimelineItem(sb.selected) + op, err := snap.SearchTimelineItem(entity.Id(sb.selected)) if err != nil { return err } @@ -650,10 +651,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.ID(), message) + return editCommentWithEditor(sb.bug, op.Id(), message) case *bug.CreateTimelineItem: preMessage := op.(*bug.CreateTimelineItem).Message - return editCommentWithEditor(sb.bug, op.ID(), 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 2a0b64e9..5d3bb0c1 100644 --- a/termui/termui.go +++ b/termui/termui.go @@ -6,6 +6,7 @@ import ( "github.com/pkg/errors" "github.com/MichaelMure/git-bug/cache" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/input" ) @@ -237,7 +238,7 @@ func addCommentWithEditor(bug *cache.BugCache) error { return errTerminateMainloop } -func editCommentWithEditor(bug *cache.BugCache, target string, preMessage string) error { +func editCommentWithEditor(bug *cache.BugCache, target entity.Id, 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. |