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

pkg/cli/tk/listbox_window.go: Fix divide by zero #1736

Closed
wants to merge 1 commit into from

Conversation

rsteube
Copy link
Contributor

@rsteube rsteube commented Dec 6, 2023

Fix divide by zero when resizing terminal.

Steps to reproduce:

  1. invoke completion menu
  2. reduce height of terminal window

related #1282

@xiaq
Copy link
Member

xiaq commented Dec 27, 2023

This does fix the crash, but it means that when the available height is 1 all that is visible is the scrollbar, which isn't ideal. Better to show one row of actual content instead. I'm preparing that fix.

xiaq added a commit that referenced this pull request Dec 31, 2023
Fix the division by 0, and special-case this condition to show one row of
content and hide the scrollbar.

This supersedes #1736.
@xiaq
Copy link
Member

xiaq commented Dec 31, 2023

I've implemented the fix I described so I'll close this PR. Thanks for the contribution.

@xiaq xiaq closed this Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants