Skip to content

[Config] Accept a [diff] section with an optional pager - #52

Closed
KCaverly wants to merge 1 commit into
ct/diff_view/ecdcdaf3from
ct/diff_view/f57c8815
Closed

[Config] Accept a [diff] section with an optional pager#52
KCaverly wants to merge 1 commit into
ct/diff_view/ecdcdaf3from
ct/diff_view/f57c8815

Conversation

@KCaverly

@KCaverly KCaverly commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Adds the Diff config: args and exclude, threaded into repo.DiffOptions,
plus a [diff.pager] subtable naming an external formatter each file's
patch is piped through. Omitting the subtable keeps ct's built-in
styling, which stays the default.

A literal {width} in the pager args is replaced with the viewer's current
column count, so a formatter can be sized to the pane.

This is the commit that restores the build: the TUI wiring in ea96527
imports internal/diffpager and reads cfg.Diff.Pager, neither of which
existed in the tree until now.

Covers the config parsing and the chunk-rendering path in the viewer.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com


Stack (bottom → top):

  1. [Diff] Thread the [diff] config through the viewer and zoom with z #49
  2. [Git] Carry diff args and excludes through every diff call #50
  3. [Diff] Add the external diff pager package #51
  4. [Config] Accept a [diff] section with an optional pager #52 ← this PR
  5. [Docs] Document the diff viewer settings #53

@KCaverly
KCaverly force-pushed the ct/diff_view/ecdcdaf3 branch from bf58975 to f171fc0 Compare July 26, 2026 19:24
@KCaverly
KCaverly force-pushed the ct/diff_view/f57c8815 branch from 9df0699 to af0420d Compare July 26, 2026 19:24
@KCaverly
KCaverly force-pushed the ct/diff_view/ecdcdaf3 branch from f171fc0 to 22ec827 Compare July 26, 2026 19:31
@KCaverly
KCaverly force-pushed the ct/diff_view/f57c8815 branch from af0420d to 8e2a333 Compare July 26, 2026 19:31
@KCaverly
KCaverly force-pushed the ct/diff_view/ecdcdaf3 branch from 22ec827 to 28be7c0 Compare July 26, 2026 19:34
@KCaverly
KCaverly force-pushed the ct/diff_view/f57c8815 branch from 8e2a333 to 0310164 Compare July 26, 2026 19:34
@KCaverly
KCaverly force-pushed the ct/diff_view/ecdcdaf3 branch from 28be7c0 to e95e5f5 Compare July 26, 2026 19:40
@KCaverly
KCaverly force-pushed the ct/diff_view/f57c8815 branch from 0310164 to a943147 Compare July 26, 2026 19:40
@KCaverly
KCaverly force-pushed the ct/diff_view/ecdcdaf3 branch from e95e5f5 to a8efe62 Compare July 26, 2026 19:41
@KCaverly
KCaverly force-pushed the ct/diff_view/f57c8815 branch from a943147 to a2595d6 Compare July 26, 2026 19:41
Adds the Diff config: args and exclude, threaded into repo.DiffOptions,
plus a [diff.pager] subtable naming an external formatter each file's
patch is piped through. Omitting the subtable keeps ct's built-in
styling, which stays the default.

A literal {width} in the pager args is replaced with the viewer's current
column count, so a formatter can be sized to the pane.

This is the commit that restores the build: the TUI wiring in ea96527
imports internal/diffpager and reads cfg.Diff.Pager, neither of which
existed in the tree until now.

Covers the config parsing and the chunk-rendering path in the viewer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ct-stack-id: f57c8815
@KCaverly
KCaverly force-pushed the ct/diff_view/ecdcdaf3 branch from a8efe62 to 73c72f3 Compare July 26, 2026 20:27
@KCaverly
KCaverly force-pushed the ct/diff_view/f57c8815 branch from a2595d6 to 100adca Compare July 26, 2026 20:27
@KCaverly

Copy link
Copy Markdown
Owner Author

Folded into #49. This commit's tests call m.diffOptions() and m.diffPager() from the viewer, while the viewer reads cfg.Diff.Pager defined here — a genuine cycle that no ordering resolves. Squashed together to get the stack building; no content dropped.

@KCaverly KCaverly closed this Jul 26, 2026
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