Add comment calling out the fork + import table_test.go too

This commit is contained in:
David Dworken
2023-02-11 08:51:28 -08:00
parent 269ccc9f9a
commit e1cb97f7c6
2 changed files with 62 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
// Forked from https://github.com/charmbracelet/bubbles/blob/master/table/table.go to add horizontal scrolling
package table
import (
@@ -137,9 +139,9 @@ func New(opts ...Option) Model {
KeyMap: DefaultKeyMap(),
styles: DefaultStyles(),
hcol: -1,
hstep: 10,
hcursor: 0,
hcol: -1,
hstep: 10,
hcursor: 0,
}
for _, opt := range opts {
@@ -326,7 +328,7 @@ func (m *Model) MaxHScroll() int {
maxWidth = max(len(row[index]), maxWidth)
}
}
return max(maxWidth-m.cols[index].Width+1, 0)
return max(maxWidth-m.cols[index].Width+1, 0)
}
// SetWidth sets the width of the viewport of the table.