fix: keep position column aligned for large offsets (fixes #228) - #278
fix: keep position column aligned for large offsets (fixes #228)#278wyf027 wants to merge 1 commit into
Conversation
Dynamically size the position field and border based on the maximum displayed offset. Fixes #228. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f41f07ed41
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let mut content = Vec::new(); | ||
| reader.read_to_end(&mut content)?; |
There was a problem hiding this comment.
Restore streaming reads in normal print mode
In IncludeMode::Off, print_all now buffers the entire input with read_to_end before printing, which changes behavior from streaming to full preloading. This can cause unbounded memory growth (or OOM) on large files and makes piped/long-running stdin sources produce no output until EOF, which is a functional regression from the previous chunked BufReader loop.
Useful? React with 👍 / 👎.
Summary
--display-offsetor--skipproduce offsets beyond 32-bit range (e.g.0x10000002f0).*) to the same width so squeezed rows stay aligned.Fixes #228.
Test plan
cargo test display_offsetlarge_display_offset_keeps_columns_alignedunit test