Skip to content

Commit

Permalink
Merge pull request #2432 from midichef/misc_minor_202406
Browse files Browse the repository at this point in the history
[misc-] fix minor typos, and add-rows prompt
  • Loading branch information
anjakefala committed Jul 1, 2024
2 parents 002cd84 + cb95380 commit 7d4b590
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions visidata/modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion visidata/pyobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions visidata/sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7d4b590

Please sign in to comment.