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

fix overflow bug on bookmark widget when area is too small #483

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

pantosaur
Copy link
Contributor

I found a bug where I get the following panic when there are too many bookmarks to fit inside the UI area:

thread 'main' panicked at src/commands/bookmark.rs:121:20:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The y coordinate of the ratatui::layout::Rect becomes -1 at line 121

I also made sure to truncate the TuiMenu options field to the maximum length, apparently area.height as usize - 1, whenever it exceeds that value

@kamiyaa kamiyaa merged commit 203bd89 into kamiyaa:main Feb 13, 2024
4 checks passed
@kamiyaa
Copy link
Owner

kamiyaa commented Feb 13, 2024

LGTM Thanks!

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.

2 participants