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

Function Run

termui/termui.go:52–81  ·  view source on GitHub ↗

Run will launch the termUI in the terminal

(cache *cache.RepoCache)

Source from the content-addressed store, hash-verified

50
51// Run will launch the termUI in the terminal
52func Run(cache *cache.RepoCache) error {
53 ui = &termUI{
54 gError: make(chan error, 1),
55 cache: cache,
56 bugTable: newBugTable(cache),
57 showBug: newShowBug(cache),
58 labelSelect: newLabelSelect(),
59 msgPopup: newMsgPopup(),
60 inputPopup: newInputPopup(),
61 }
62
63 ui.activeWindow = ui.bugTable
64
65 initGui(nil)
66
67 err := <-ui.gError
68
69 type errorStack interface {
70 ErrorStack() string
71 }
72
73 if err != nil && err != gocui.ErrQuit {
74 if e, ok := err.(errorStack); ok {
75 fmt.Println(e.ErrorStack())
76 }
77 return err
78 }
79
80 return nil
81}
82
83func initGui(action func(ui *termUI) error) {
84 g, err := gocui.NewGui(gocui.Output256, false)

Callers 1

runTermUIFunction · 0.92

Calls 8

newBugTableFunction · 0.85
newShowBugFunction · 0.85
newLabelSelectFunction · 0.85
newMsgPopupFunction · 0.85
newInputPopupFunction · 0.85
initGuiFunction · 0.85
ErrorStackMethod · 0.80
PrintlnMethod · 0.65

Tested by

no test coverage detected