nushell/crates/nu-explore
Chetan 8e41a308cd
fix(explore): handle zero-size cursor in binary viewer (#14592)
# Description
Fix cursor panic when handling size zero in binary viewer. Previously,
the cursor would panic
with arithmetic overflow when handling size 0. This PR fixes this by
using `saturating_sub`
to safely handle the edge case of size 0.

Fixes #14589

# User-Facing Changes
- Fixed panic when viewing very small binary inputs in the explore
command (when using `0x[f] | explore`)

# Tests + Formatting
Added tests to verify:
- Cursor handling of size 0
- Safe movement operations with size 0
- Edge case handling with size 1

 Verified all checks pass:
- `cargo fmt --all -- --check`
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used`
- `cargo test --package nu-explore --lib cursor`
2025-01-07 12:10:25 -06:00
..
src fix(explore): handle zero-size cursor in binary viewer (#14592) 2025-01-07 12:10:25 -06:00
.gitignore [MVP][WIP] less like pager (#6984) 2022-12-01 09:32:10 -06:00
Cargo.toml Bump version to 0.101.1 (#14661) 2024-12-24 23:47:00 +01:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00
README.md Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00

Implementation of the interactive explore command pager.

Internal Nushell crate

This crate implements components of Nushell and is not designed to support plugin authors or other users directly.