From 8ef2c485500f0ac11d8527199823dd80bdb99084 Mon Sep 17 00:00:00 2001 From: David Wales Date: Tue, 9 May 2023 14:33:41 +1000 Subject: [PATCH] Don't truncate wide columns with fixed width saver (#1890) Previously the fixed width saver would truncate saved data to match viewed column widths. Now it saves all the data regardless of the viewed column widths. Co-authored-by: Anja Kefala --- visidata/loaders/fixed_width.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/visidata/loaders/fixed_width.py b/visidata/loaders/fixed_width.py index 684b644c9..c1f15eab1 100644 --- a/visidata/loaders/fixed_width.py +++ b/visidata/loaders/fixed_width.py @@ -84,8 +84,7 @@ def save_fixed(vd, p, *vsheets): widths = {} # Column -> width:int # headers for col in Progress(sheet.visibleCols, gerund='sizing'): - maxWidth = col.getMaxWidth(sheet.rows) - widths[col] = col.width if col.width >= maxWidth else sheet.options.default_width or maxWidth + widths[col] = col.getMaxWidth(sheet.rows) #1849 fp.write(('{0:%s} ' % widths[col]).format(col.name)) fp.write('\n')