mirror of https://github.com/rivo/tview.git
Bugfix which caused a crash in Table class. Fixes #67
This commit is contained in:
parent
c2f07f9548
commit
c96894c0cf
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
1
table.go
1
table.go
|
@ -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)?
|
||||||
|
|
Loading…
Reference in New Issue