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

--commit-style box and/or --file-style box causes write_boxed_with_line to panic #18

Closed
nkouevda opened this issue Oct 3, 2019 · 1 comment · Fixed by #21
Closed

Comments

@nkouevda
Copy link

nkouevda commented Oct 3, 2019

With a narrow terminal (<= 48 chars), --commit-style box results in:

> git show
thread 'main' panicked at 'attempt to subtract with overflow', src/draw.rs:39:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Because line_width <= box_width, so line_width - box_width - 1 would be negative.

Or a more practical scenario: even with a reasonably wide terminal, very long filenames cause the same issue under --file-style box.

@dandavison
Copy link
Owner

Thanks @nkouevda! These should be fixed in v0.0.13

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 a pull request may close this issue.

2 participants