Skip to content

Commit

Permalink
redraw on resize
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Chain committed Feb 13, 2020
1 parent b2f6b5a commit 03053cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ func New() (*UI, error) {
return nil, err
}

ui := &UI{gui: gui}
gui.SetManager(ui)
gui.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit)
gui.SetKeybinding("", 'q', gocui.ModNone, quit)

return &UI{gui: gui}, nil
return ui, nil
}

func quit(*gocui.Gui, *gocui.View) error { return gocui.ErrQuit }
Expand Down Expand Up @@ -71,12 +73,10 @@ func (ui *UI) Render(resp *client.Response) {
ui.state.projected = bs
}

ui.gui.Update(func(g *gocui.Gui) error {
return ui.update(g)
})
ui.gui.Update(ui.Layout)
}

func (ui *UI) update(g *gocui.Gui) error {
func (ui *UI) Layout(g *gocui.Gui) error {
x, y := g.Size()

// whether or not use vertical layout
Expand Down

0 comments on commit 03053cd

Please sign in to comment.