[layout-] stop errors: hide-col on empty sheet, inputMultiple() #1963
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A minor fix for
hide-col
in version 2.11: if you accidentally press-
too many times and hide on an empty sheet, you will see a scary exception:AttributeError: 'NoneType' object has no attribute 'hide'
. This fixes that.My logic for fixing these little error messages, is that it's good to keep new users from triggering them. When people are new and don't know how visidata works, and can't remember what all the keys do, it can be intimidating to explore. I remember thinking "Oh no, what did I just press, there is the red exclamation point again! Did I break something? Am I going to break it all worse?" I triggered this particular error myself by accident, so other people probably will too.
Should we add the same kind of protection for other keys that give errors on an empty sheet, like
d
andx
?The second fix is for the develop branch. If
value
is not provided toinputMultiple()
, it will now fall back on a value of''
instead ofNone
. As it is, if you runvd --debug
to see the exceptions, and dosearch-col
, you will see: