Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions internal/action/tab.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ func (t *TabList) RemoveTab(id uint64) {
}
}

// MoveTab moves the specified tab to the given index
func (tl *TabList) MoveTab(t *Tab, i int) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same naming style for arguments as in other TabList methods? i.e.

 func (t *TabList) MoveTab(p *Tab, i int)

if i == tl.Active() || i < 0 || i >= len(tl.List) {
return
}
tl.RemoveTab(t.Panes[0].ID())
tl.List = append(tl.List, nil)
copy(tl.List[i+1:], tl.List[i:])
tl.List[i] = t
tl.Resize()
tl.UpdateNames()
}

// Resize resizes all elements within the tab list
// One thing to note is that when there is only 1 tab
// the tab bar should not be drawn so resizing must take
Expand Down