From 9421130978fbc7e62c95bffb5549ccf9a97e3f0c Mon Sep 17 00:00:00 2001 From: midichef <67946319+midichef@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:44:10 -0800 Subject: [PATCH 1/3] [sheets- pyobj-] fix minor typos --- visidata/pyobj.py | 2 +- visidata/sheets.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/visidata/pyobj.py b/visidata/pyobj.py index 8f9ac4176..bb7c1724c 100644 --- a/visidata/pyobj.py +++ b/visidata/pyobj.py @@ -202,7 +202,7 @@ def reload(self): for r in dir(self.source): # reading these attributes can cause distracting fail() messages if r in ('onlySelectedRows', 'someSelectedRows'): - vd.warning('skipping attribute: {r}') + vd.warning(f'skipping attribute: {r}') continue try: if vislevel <= 2 and r.startswith('__'): continue diff --git a/visidata/sheets.py b/visidata/sheets.py index 55acf3697..580f36761 100644 --- a/visidata/sheets.py +++ b/visidata/sheets.py @@ -808,7 +808,7 @@ def draw(self, scr): scr.addstr(headerRow, self.windowWidth-2, self.options.disp_more_right, colors.color_column_sep.attr) def calc_height(self, row, displines=None, isNull=None, maxheight=1): - 'render cell contents ifor row into displines' + 'render cell contents for row into displines' if displines is None: displines = {} # [vcolidx] -> list of lines in that cell @@ -1169,7 +1169,7 @@ def _async_deepcopy(newlist, oldlist): BaseSheet.addCommand('`', 'open-source', 'vd.push(source)', 'open source sheet') BaseSheet.addCommand(None, 'rename-sheet', 'sheet.name = input("rename sheet to: ", value=cleanName(sheet.name))', 'Rename current sheet') -Sheet.addCommand('', 'addcol-source', 'source .addColumn(copy(cursorCol)) if isinstance (source, BaseSheet) else error("source must be sheet")', 'add copy of current column to source sheet') #988 frosencrantz +Sheet.addCommand('', 'addcol-source', 'source.addColumn(copy(cursorCol)) if isinstance (source, BaseSheet) else error("source must be sheet")', 'add copy of current column to source sheet') #988 frosencrantz @Column.api From dcb64eccdc454520c8e3fbe3f408f5ca7e3cc987 Mon Sep 17 00:00:00 2001 From: midichef <67946319+midichef@users.noreply.github.com> Date: Wed, 26 Jun 2024 23:58:54 -0700 Subject: [PATCH 2/3] [modify-] clarify prompt for add-rows --- visidata/modify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visidata/modify.py b/visidata/modify.py index f4dfb477f..8407c2333 100644 --- a/visidata/modify.py +++ b/visidata/modify.py @@ -330,7 +330,7 @@ def new_rows(sheet, n): return [sheet.newRow() for i in range(n)] Sheet.addCommand('a', 'add-row', 'addRows([newRow()], index=cursorRowIndex); cursorDown(1)', 'append a blank row') -Sheet.addCommand('ga', 'add-rows', 'n=int(input("add rows: ", value=1)); addRows(new_rows(n), index=cursorRowIndex); cursorDown(1)', 'append N blank rows') +Sheet.addCommand('ga', 'add-rows', 'n=int(input("add # rows: ", value=1)); addRows(new_rows(n), index=cursorRowIndex); cursorDown(1)', 'append N blank rows') Sheet.addCommand('za', 'addcol-new', 'addColumnAtCursor(SettableColumn(input("column name: ")))', 'append an empty column') Sheet.addCommand('gza', 'addcol-bulk', 'addColumnAtCursor(*(SettableColumn() for c in range(int(input("add columns: ")))))', 'append N empty columns') From cb9538096e93a4db5c6bca83e3a2eb862eb9b829 Mon Sep 17 00:00:00 2001 From: midichef <67946319+midichef@users.noreply.github.com> Date: Sat, 29 Jun 2024 10:31:28 -0700 Subject: [PATCH 3/3] [modify-] clarify warnings for undo after commit --- visidata/modify.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/visidata/modify.py b/visidata/modify.py index 8407c2333..1e5adf4f4 100644 --- a/visidata/modify.py +++ b/visidata/modify.py @@ -65,7 +65,7 @@ def rowAdded(self, row): self._deferredAdds[self.rowid(row)] = row def _undoRowAdded(sheet, row): if sheet.rowid(row) not in sheet._deferredAdds: - vd.warning('cannot undo to before commit') + vd.warning('cannot undo row addition after a commit') return del sheet._deferredAdds[sheet.rowid(row)] vd.addUndo(_undoRowAdded, self, row) @@ -87,7 +87,7 @@ def _undoCellChanged(col, row, oldval): if oldval == col.getSourceValue(row): # if we have reached the original value, remove from defermods entirely if col.sheet.rowid(row) not in col.sheet._deferredMods: - vd.warning('cannot undo to before commit') + vd.warning('cannot undo cell change after a commit') return del col.sheet._deferredMods[col.sheet.rowid(row)] else: @@ -105,7 +105,7 @@ def rowDeleted(self, row): self.unselectRow(row) def _undoRowDeleted(sheet, row): if sheet.rowid(row) not in sheet._deferredDels: - vd.warning('cannot undo to before commit') + vd.warning('cannot undo row deletion after a commit') return del sheet._deferredDels[sheet.rowid(row)] vd.addUndo(_undoRowDeleted, self, row)