Skip to content
Open
Changes from all commits
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
11 changes: 11 additions & 0 deletions pkg/gui/context/migrations_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type MigrationsContext struct {
}

var _ types.Context = &MigrationsContext{}
var _ types.IListContext = &MigrationsContext{}

type MigrationsContextOpts struct {
Gui *gocui.Gui
Expand Down Expand Up @@ -276,6 +277,16 @@ func (m *MigrationsContext) SelectPrev() {
}
}

// GetSelectedIdx returns the index of the currently selected item.
func (m *MigrationsContext) GetSelectedIdx() int {
return m.selected
}

// GetItemCount returns the number of items in the current tab.
func (m *MigrationsContext) GetItemCount() int {
return len(m.items)
}

// ---------------------------------------------------------------------------
// Scroll overrides (list-aware: also update selection)
// ---------------------------------------------------------------------------
Expand Down