From a3e0b1470dbd4652f385749b485e336efccd87e1 Mon Sep 17 00:00:00 2001 From: Miguel Mota Date: Mon, 30 Apr 2018 15:19:25 -0700 Subject: [PATCH] select last row if out of bounds --- cointop/table.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cointop/table.go b/cointop/table.go index 1664cb6..4d0e710 100644 --- a/cointop/table.go +++ b/cointop/table.go @@ -86,6 +86,12 @@ func (ct *Cointop) refreshTable() error { ) } + // highlight last row if current row is out of bounds (can happen when switching views) + currentrow := ct.highlightedRowIndex() + if len(ct.coins) > currentrow { + ct.highlightRow(currentrow) + } + ct.update(func() { ct.tableview.Clear() ct.table.Format().Fprint(ct.tableview)