Skip to content

Commit

Permalink
[fixed] use maxWidth for saving if larger than column width
Browse files Browse the repository at this point in the history
Closes #1849
  • Loading branch information
anjakefala committed May 7, 2023
1 parent d0fa363 commit 77ae017
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion visidata/loaders/fixed_width.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def save_fixed(vd, p, *vsheets):
widths = {} # Column -> width:int
# headers
for col in Progress(sheet.visibleCols, gerund='sizing'):
widths[col] = col.width or sheet.options.default_width or col.getMaxWidth(sheet.rows)
maxWidth = col.getMaxWidth(sheet.rows)
widths[col] = col.width if col.width >= maxWidth else sheet.options.default_width or maxWidth
fp.write(('{0:%s} ' % widths[col]).format(col.name))
fp.write('\n')

Expand Down

0 comments on commit 77ae017

Please sign in to comment.