Bugfix which caused a crash in Table class. Fixes #67

This commit is contained in:
Oliver 2018-03-10 12:59:42 +01:00
parent c2f07f9548
commit c96894c0cf
2 changed files with 6 additions and 3 deletions

View File

@ -270,9 +270,11 @@ func (a *Application) SetFocus(p Primitive) *Application {
a.screen.HideCursor() a.screen.HideCursor()
} }
a.Unlock() a.Unlock()
p.Focus(func(p Primitive) { if p != nil {
a.SetFocus(p) p.Focus(func(p Primitive) {
}) a.SetFocus(p)
})
}
return a return a
} }

View File

@ -582,6 +582,7 @@ ColumnLoop:
tableWidth -= widths[t.fixedColumns] + 1 tableWidth -= widths[t.fixedColumns] + 1
columns = append(columns[:t.fixedColumns], columns[t.fixedColumns+1:]...) columns = append(columns[:t.fixedColumns], columns[t.fixedColumns+1:]...)
widths = append(widths[:t.fixedColumns], widths[t.fixedColumns+1:]...) widths = append(widths[:t.fixedColumns], widths[t.fixedColumns+1:]...)
expansions = append(expansions[:t.fixedColumns], expansions[t.fixedColumns+1:]...)
} }
// What's this column's width (without expansion)? // What's this column's width (without expansion)?