Add :term-close

This commit is contained in:
Drew DeVault 2019-03-17 17:23:53 -04:00
commit dee0f8938b
6 changed files with 85 additions and 17 deletions

View file

@ -62,13 +62,13 @@ func (tabs *Tabs) Remove(content Drawable) {
}
/* Force the selected index into the existing range */
if tabs.Selected >= len(tabs.Tabs) {
tabs.Select(len(tabs.Tabs) - 1)
tabs.Select(tabs.Selected - 1)
}
tabs.TabStrip.Invalidate()
}
func (tabs *Tabs) Select(index int) {
if tabs.Selected >= len(tabs.Tabs) {
if index >= len(tabs.Tabs) {
panic("Tried to set tab index to a non-existing element")
}

View file

@ -20,7 +20,11 @@ type Text struct {
}
func NewText(text string) *Text {
return &Text{text: text}
return &Text{
bg: tcell.ColorDefault,
fg: tcell.ColorDefault,
text: text,
}
}
func (t *Text) Text(text string) *Text {