File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,9 @@ func (m *Model) FromValues(value, separator string) {
426
426
func (m Model ) headersView () string {
427
427
var s = make ([]string , 0 , len (m .cols ))
428
428
for _ , col := range m .cols {
429
+ if col .Width <= 0 {
430
+ continue
431
+ }
429
432
style := lipgloss .NewStyle ().Width (col .Width ).MaxWidth (col .Width ).Inline (true )
430
433
renderedCell := style .Render (runewidth .Truncate (col .Title , col .Width , "…" ))
431
434
s = append (s , m .styles .Header .Render (renderedCell ))
@@ -436,6 +439,9 @@ func (m Model) headersView() string {
436
439
func (m * Model ) renderRow (rowID int ) string {
437
440
var s = make ([]string , 0 , len (m .cols ))
438
441
for i , value := range m .rows [rowID ] {
442
+ if m .cols [i ].Width <= 0 {
443
+ continue
444
+ }
439
445
style := lipgloss .NewStyle ().Width (m .cols [i ].Width ).MaxWidth (m .cols [i ].Width ).Inline (true )
440
446
renderedCell := m .styles .Cell .Render (style .Render (runewidth .Truncate (value , m .cols [i ].Width , "…" )))
441
447
s = append (s , renderedCell )
You can’t perform that action at this time.
0 commit comments