From 759db7be66cc5a954c74e9bb334cf3ca3f8de9e7 Mon Sep 17 00:00:00 2001 From: anjakefala Date: Sat, 2 Apr 2022 20:03:08 -0700 Subject: [PATCH] [save-selected] get sheet names from selectedRows Only saving selectedRows, so the sheet names should be pulled from there. Not all IndexSheets carry their sub-sheets in their `source`. Closes #1339 --- visidata/save.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visidata/save.py b/visidata/save.py index bea68e261..bda48eac4 100644 --- a/visidata/save.py +++ b/visidata/save.py @@ -163,6 +163,6 @@ def save_txt(vd, p, *vsheets): BaseSheet.addCommand('^S', 'save-sheet', 'vd.saveSheets(inputPath("save to: ", value=getDefaultSaveName()), sheet, confirm_overwrite=options.confirm_overwrite)', 'save current sheet to filename in format determined by extension (default .tsv)') BaseSheet.addCommand('g^S', 'save-all', 'vd.saveSheets(inputPath("save all sheets to: "), *vd.stackedSheets, confirm_overwrite=options.confirm_overwrite)', 'save all sheets to given file or directory)') -IndexSheet.addCommand('g^S', 'save-selected', 'vd.saveSheets(inputPath("save %d sheets to: " % nSelectedRows, value="_".join(vs.name or "blank" for vs in source)), *selectedRows, confirm_overwrite=options.confirm_overwrite)', 'save all selected sheets to given file or directory') +IndexSheet.addCommand('g^S', 'save-selected', 'vd.saveSheets(inputPath("save %d sheets to: " % nSelectedRows, value="_".join(getattr(vs, "name", None) or "blank" for vs in selectedRows)), *selectedRows, confirm_overwrite=options.confirm_overwrite)', 'save all selected sheets to given file or directory') Sheet.addCommand('', 'save-col', 'save_cols([cursorCol])', 'save current column only to filename in format determined by extension (default .tsv)') Sheet.addCommand('', 'save-col-keys', 'save_cols(keyCols + [cursorCol])', 'save key columns and current column to filename in format determined by extension (default .tsv)')