Skip to content

Commit

Permalink
[sheets-] fix error adding col to sheet with no visible cols
Browse files Browse the repository at this point in the history
  • Loading branch information
midichef committed Nov 29, 2024
1 parent 7e75dee commit c1f32eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion visidata/sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,10 @@ def addColumnAtCursor(self, *cols):
index = 0
ccol = self.cursorCol
if ccol and not ccol.keycol:
index = self.columns.index(ccol)+1
try:
index = self.columns.index(ccol)+1
except ValueError: # when all columns are hidden, the one column shown is not in self.columns
index = 0

self.addColumn(*cols, index=index)
firstnewcol = [c for c in cols if not c.hidden][0]
Expand Down

0 comments on commit c1f32eb

Please sign in to comment.