mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
Fix bug in labelSelect addItem
Adding a new item would cause a panic because focusView attempted to access a view that did not yet exist. Fixed by calling layout before calling focusView.
This commit is contained in:
parent
f50d65b892
commit
3378e6409e
@ -228,8 +228,10 @@ func (ls *labelSelect) addItem(g *gocui.Gui, v *gocui.View) error {
|
||||
ls.labelSelect = append(ls.labelSelect, true)
|
||||
ls.selected = len(ls.labels) - 1
|
||||
|
||||
ls.layout(g)
|
||||
|
||||
if err := ls.focusView(g); err != nil {
|
||||
return err
|
||||
panic(err)
|
||||
}
|
||||
|
||||
g.Update(func(gui *gocui.Gui) error {
|
||||
|
Loading…
Reference in New Issue
Block a user