diff --git a/visidata/cmdlog.py b/visidata/cmdlog.py index 3c2ded218..f80ef05ea 100644 --- a/visidata/cmdlog.py +++ b/visidata/cmdlog.py @@ -45,7 +45,7 @@ def checkVersion(vd, desired_version): vd.fail("version %s required" % desired_version) @VisiData.api -def fnSuffix(vd, prefix): +def fnSuffix(vd, prefix:str): i = 0 fn = prefix + '.vdj' while Path(fn).exists(): diff --git a/visidata/macros.py b/visidata/macros.py index 581b6f802..fc7bf97bf 100644 --- a/visidata/macros.py +++ b/visidata/macros.py @@ -84,7 +84,7 @@ def setMacro(ks, vs): def saveMacro(self, rows, ks): vs = copy(self) vs.rows = rows - macropath = Path(vd.fnSuffix(vd.options.visidata_dir+"macro")) + macropath = Path(vd.fnSuffix(str(Path(vd.options.visidata_dir)/ks))) vd.save_vdj(macropath, vs) setMacro(ks, vs) vd.macrosheet.source.append_tsv_row((ks, macropath))