aboutsummaryrefslogtreecommitdiffstats
path: root/termui
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-05-03 11:45:15 +0200
committerMichael Muré <batolettre@gmail.com>2022-08-22 13:25:26 +0200
commit45b04351d8d02e53b3401b0ee23f7cbe750b63cd (patch)
tree59d203ef6c0f6a497b7074cd5617c8869cac3b14 /termui
parent43026fc53669d462a60feec7d22aec090959be72 (diff)
downloadgit-bug-45b04351d8d02e53b3401b0ee23f7cbe750b63cd.tar.gz
bug: have a type for combined ids, fix https://github.com/MichaelMure/git-bug/issues/653
Diffstat (limited to 'termui')
-rw-r--r--termui/show_bug.go8
-rw-r--r--termui/termui.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go
index 6cace04a..8bcae842 100644
--- a/termui/show_bug.go
+++ b/termui/show_bug.go
@@ -244,7 +244,7 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error {
y0 += lines + 1
for _, op := range snap.Timeline {
- viewName := op.Id().String()
+ viewName := op.CombinedId().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
@@ -647,16 +647,16 @@ func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error {
return nil
}
- op, err := snap.SearchTimelineItem(entity.Id(sb.selected))
+ op, err := snap.SearchTimelineItem(entity.CombinedId(sb.selected))
if err != nil {
return err
}
switch op := op.(type) {
case *bug.AddCommentTimelineItem:
- return editCommentWithEditor(sb.bug, op.Id(), op.Message)
+ return editCommentWithEditor(sb.bug, op.CombinedId(), op.Message)
case *bug.CreateTimelineItem:
- return editCommentWithEditor(sb.bug, op.Id(), op.Message)
+ return editCommentWithEditor(sb.bug, op.CombinedId(), op.Message)
case *bug.LabelChangeTimelineItem:
return sb.editLabels(g, snap)
}
diff --git a/termui/termui.go b/termui/termui.go
index bbbc1c6c..15476d89 100644
--- a/termui/termui.go
+++ b/termui/termui.go
@@ -250,7 +250,7 @@ func addCommentWithEditor(bug *cache.BugCache) error {
return errTerminateMainloop
}
-func editCommentWithEditor(bug *cache.BugCache, target entity.Id, preMessage string) error {
+func editCommentWithEditor(bug *cache.BugCache, target entity.CombinedId, 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.