Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[statusbar-] use '' for BaseSheet selectedStatus #2600

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

midichef
Copy link
Contributor

@midichef midichef commented Nov 7, 2024

Closes #2599.

'{selectedStatus}' appears in the GraphSheet statusbar as a raw string instead of a value. That's because selectedStatus can't be evaluated for BaseSheet.

@saulpw
Copy link
Owner

saulpw commented Nov 8, 2024

Once upon a time the graph sheet reflected the selection on the source sheet (see the unused color_graph_selected and other remnants). I believe it's still possible to select/unselect elements this way, but the selection itself is invisible. (I'd love to get that working again, but that's outside the scope of this PR.)

Copy link
Owner

@saulpw saulpw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I edited the PR to add a separate BaseSheet.property for selectedStatus that returns an empty string. OOP overloading instead of duck-typing. Note that this is untested code (though I don't see how it wouldn't work..)

@anjakefala
Copy link
Collaborator

Upon reproducing, this came up:

Traceback (most recent call last):
  File "/home/anja/git/visidata/visidata/sidebar.py", line 115, in drawSidebar
    sidebar, title = sheet.help_sidebars[vd.disp_help%len(sheet.help_sidebars)]()
                                         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: integer modulo by zero

@anjakefala
Copy link
Collaborator

Ah, this is unrelated! I will open an issue and investigate this separately. The core issue has been resolved.

@anjakefala anjakefala force-pushed the basesheet_selected_status branch from 3e091ab to 7095753 Compare November 11, 2024 04:23
@anjakefala anjakefala merged commit 396d248 into saulpw:develop Nov 11, 2024
14 checks passed
@midichef midichef deleted the basesheet_selected_status branch November 12, 2024 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VisiData showing {sheet.selectedStatus} in right corner
3 participants