Browse Source

SetOffset() also turns off end-tracking in Table. Fixes #238

tablepad
Oliver 3 years ago
parent
commit
03d744dee3
  1. 4
      list.go
  2. 1
      table.go

4
list.go

@ -424,9 +424,7 @@ func (l *List) Draw(screen tcell.Screen) { @@ -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

1
table.go

@ -368,6 +368,7 @@ func (t *Table) Select(row, column int) *Table { @@ -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
}

Loading…
Cancel
Save