From 03d744dee35eb7cd4f59bf139745bff07412b759 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 8 Mar 2019 20:13:09 +0100 Subject: [PATCH] SetOffset() also turns off end-tracking in Table. Fixes #238 --- list.go | 4 +--- table.go | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/list.go b/list.go index dd42110..e97a65b 100644 --- a/list.go +++ b/list.go @@ -424,9 +424,7 @@ func (l *List) Draw(screen tcell.Screen) { // Background color of selected text. if index == l.currentItem && (!l.selectedFocusOnly || l.HasFocus()) { - - // Width of background color of selected item. - var textWidth int = width + textWidth := width if !l.highlightFullLine { if w := StringWidth(item.MainText); w < textWidth { textWidth = w diff --git a/table.go b/table.go index fb9e162..2e411ea 100644 --- a/table.go +++ b/table.go @@ -368,6 +368,7 @@ func (t *Table) Select(row, column int) *Table { // Fixed rows and columns are never skipped. func (t *Table) SetOffset(row, column int) *Table { t.rowOffset, t.columnOffset = row, column + t.trackEnd = false return t }