Browse Source

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

tablepad
Oliver 4 years ago
parent
commit
c96894c0cf
  1. 8
      application.go
  2. 1
      table.go

8
application.go

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

1
table.go

@ -582,6 +582,7 @@ ColumnLoop: @@ -582,6 +582,7 @@ ColumnLoop:
tableWidth -= widths[t.fixedColumns] + 1
columns = append(columns[:t.fixedColumns], columns[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)?

Loading…
Cancel
Save