Skip to content

Commit

Permalink
[cursor-] cursorColIndex return None if empty #1803
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Mar 31, 2023
1 parent 2b36f3b commit d92b66a
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 @@ -372,7 +372,10 @@ def _ordered_colnames(self):
@property
def cursorColIndex(self):
'Index of current column into `Sheet.columns`. Linear search; prefer `cursorCol` or `cursorVisibleColIndex`.'
return self.columns.index(self.cursorCol)
try:
return self.columns.index(self.cursorCol)
except ValueError:
return None

@property
def nonKeyVisibleCols(self):
Expand Down

0 comments on commit d92b66a

Please sign in to comment.