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 @@ -387,6 +387,9 @@ func (m *Model) FromValues(value, separator string) {
387
387
func (m Model ) headersView () string {
388
388
var s = make ([]string , 0 , len (m .cols ))
389
389
for _ , col := range m .cols {
390
+ if col .Width <= 0 {
391
+ continue
392
+ }
390
393
style := lipgloss .NewStyle ().Width (col .Width ).MaxWidth (col .Width ).Inline (true )
391
394
renderedCell := style .Render (runewidth .Truncate (col .Title , col .Width , "…" ))
392
395
s = append (s , m .styles .Header .Render (renderedCell ))
@@ -397,6 +400,9 @@ func (m Model) headersView() string {
397
400
func (m * Model ) renderRow (rowID int ) string {
398
401
var s = make ([]string , 0 , len (m .cols ))
399
402
for i , value := range m .rows [rowID ] {
403
+ if m .cols [i ].Width <= 0 {
404
+ continue
405
+ }
400
406
style := lipgloss .NewStyle ().Width (m .cols [i ].Width ).MaxWidth (m .cols [i ].Width ).Inline (true )
401
407
renderedCell := m .styles .Cell .Render (style .Render (runewidth .Truncate (value , m .cols [i ].Width , "…" )))
402
408
s = append (s , renderedCell )
You can’t perform that action at this time.
0 commit comments