Skip to content

Honor full and numeric reader widths while preserving defaults - #34

Merged
borghei merged 3 commits into
borghei:mainfrom
narma:feat/full-width-reader
Oct 23, 2026
Merged

borghei merged 3 commits into
borghei:mainfrom
narma:feat/full-width-reader

Conversation

@narma

@narma narma commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

On a wide terminal, -w full and numeric widths above 120 were still limited to 120 columns in the interactive reader.

Honor explicit numeric widths up to the available document pane and let -w full use the entire pane with two-column margins. Preserve the default 120-column reading width and existing plain output behavior. Update the CLI documentation and cover explicit widths, margins, narrow windows, the TOC pane, and plain output with regression tests, including an end-to-end PTY test.

Validation:

  • 535 tests passed: env -u NO_COLOR TERM=xterm-256color cargo test --offline.
  • cargo fmt --check passed.
  • cargo clippy --offline -- -D warnings passed.

AI assistance was used to prepare this change.

@narma
narma force-pushed the feat/full-width-reader branch from 56a8cf2 to 05af89a Compare October 8, 2026 19:48
@elementalvoid

Copy link
Copy Markdown

👍 I've been loving ink but that it wasn't honoring the full width config was bugging me too. I came here to see about filing an issue/creating a PR and found your PR. Thank you!

I've tested your changes on my machine and it's working as desired. It would be great to see this merged.

@borghei

borghei commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Thanks, this was a real bug, and your tests made it easy to review. Merging now. I'm adding a small change on top: one Width type instead of the new full_width field, and width = "full" in the config file. You're in the README contributors list. And thanks @elementalvoid for testing it.

@borghei
borghei merged commit 7735f84 into borghei:main Oct 23, 2026
8 checks passed
borghei added a commit that referenced this pull request Oct 23, 2026
…#37)

* refactor(width): one Width type for --width, the config file and Args

Replaces Args.width: Option<u16> plus Args.full_width: bool with
Args.width: Width { Auto, Columns(n), Full }, shared by the CLI parser and
the config file, and adds Default for Args so library callers can write
Args { width, ..Default::default() } and stop breaking when fields are added.

The config file now takes the --width keywords: width = "full", "wide"
or "narrow" (previously only a number; strings were rejected).

Credits @narma in the README for #34.

* refactor(width): mark Width non_exhaustive
@borghei borghei mentioned this pull request Oct 23, 2026
@narma
narma deleted the feat/full-width-reader branch October 23, 2026 18:14
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.

3 participants