Skip to content

Commit

Permalink
Merge pull request #2006 from midichef/empty_delete_row
Browse files Browse the repository at this point in the history
[clipboard-] improve error when deleting row on empty sheet
  • Loading branch information
anjakefala authored Aug 30, 2023
2 parents 3abfcb1 + 715041b commit 0ba5a11
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions visidata/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def pasteFromClipboard(vd, cols, rows):

@Sheet.api
def delete_row(sheet, rowidx):
if not sheet.rows:
vd.fail("no row to delete")
if not sheet.defer:
oldrow = sheet.rows.pop(rowidx)
vd.addUndo(sheet.rows.insert, rowidx, oldrow)
Expand Down

0 comments on commit 0ba5a11

Please sign in to comment.