Skip to content

Fix 1x1 grid scrolling#29

Open
ealmloff wants to merge 1 commit into
doy:mainfrom
ealmloff:main
Open

Fix 1x1 grid scrolling#29
ealmloff wants to merge 1 commit into
doy:mainfrom
ealmloff:main

Conversation

@ealmloff

@ealmloff ealmloff commented May 4, 2026

Copy link
Copy Markdown

When adding content causes a scroll on a 1x1 grid, it causes an underflow panic:

thread 'one_row_wrap_does_not_panic' (18576866) panicked at src/grid.rs:683:13:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This PR switches to saturating sub to avoid that underflow panic

Junyi-99 pushed a commit to Junyi-99/vt100-rust that referenced this pull request May 29, 2026
(cherry picked from commit bab9727)
Upstream-PR: doy#29 by @ealmloff
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.

1 participant