(g *gocui.Gui, v *gocui.View)
| 637 | } |
| 638 | |
| 639 | func (sb *showBug) edit(g *gocui.Gui, v *gocui.View) error { |
| 640 | snap := sb.bug.Snapshot() |
| 641 | |
| 642 | if sb.isOnSide { |
| 643 | return sb.editLabels(g, snap) |
| 644 | } |
| 645 | |
| 646 | if sb.selected == "" { |
| 647 | return nil |
| 648 | } |
| 649 | |
| 650 | op, err := snap.SearchTimelineItem(entity.CombinedId(sb.selected)) |
| 651 | if err != nil { |
| 652 | return err |
| 653 | } |
| 654 | |
| 655 | switch op := op.(type) { |
| 656 | case *bug.AddCommentTimelineItem: |
| 657 | return editCommentWithEditor(sb.bug, op.CombinedId(), op.Message) |
| 658 | case *bug.CreateTimelineItem: |
| 659 | return editCommentWithEditor(sb.bug, op.CombinedId(), op.Message) |
| 660 | case *bug.LabelChangeTimelineItem: |
| 661 | return sb.editLabels(g, snap) |
| 662 | } |
| 663 | |
| 664 | ui.msgPopup.Activate(msgPopupErrorTitle, "Selected field is not editable.") |
| 665 | return nil |
| 666 | } |
| 667 | |
| 668 | func (sb *showBug) editLabels(g *gocui.Gui, snap *bug.Snapshot) error { |
| 669 | ui.labelSelect.SetBug(sb.cache, sb.bug) |
nothing calls this directly
no test coverage detected