Add :term-close
This commit is contained in:
parent
16c3f0a893
commit
dee0f8938b
6 changed files with 85 additions and 17 deletions
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue