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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/cli/tk/listbox_window.go
Expand Up @@ -112,7 +112,9 @@ func getHorizontalWindow(state ListBoxState, padding, width, height int) (int, i
}
// Reduce the amount of available height by one because the last row will be
// reserved for the scrollbar.
height--
if height--; height < 1 {
return 0, 0
}
selected, lastFirst := state.Selected, state.First
// Start with the column containing the selected item, move left until
// either the width is exhausted, or lastFirst has been reached.
Expand Down