MCPcopy Index your code
hub / github.com/git-bug/git-bug / edit

Method edit

termui/show_bug.go:639–666  ·  view source on GitHub ↗
(g *gocui.Gui, v *gocui.View)

Source from the content-addressed store, hash-verified

637}
638
639func (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
668func (sb *showBug) editLabels(g *gocui.Gui, snap *bug.Snapshot) error {
669 ui.labelSelect.SetBug(sb.cache, sb.bug)

Callers

nothing calls this directly

Calls 7

editLabelsMethod · 0.95
CombinedIdTypeAlias · 0.92
editCommentWithEditorFunction · 0.85
SnapshotMethod · 0.80
SearchTimelineItemMethod · 0.80
CombinedIdMethod · 0.65
ActivateMethod · 0.45

Tested by

no test coverage detected