diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 00:51:40 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | 4a33b8d2bd409d4a06205f28e0eb1b4cdaf49889 (patch) | |
| tree | 0451135691e451216ad89167884b42b2b0a33dca /src/ninep/ctl.zig | |
| parent | dd5aa28c89e2ca31a4cd806d6087ce4ac52398fc (diff) | |
| download | pardes-4a33b8d2bd409d4a06205f28e0eb1b4cdaf49889.tar.gz pardes-4a33b8d2bd409d4a06205f28e0eb1b4cdaf49889.zip | |
hunks: the +Diff's editor side in one place: openDiff, showDiffText and diffSource move from Output.zig, the `Diff` word's body and PaneKind.diff's test from builtins.zig, lookCommit (as lookedAtCommit) and its test from look.zig; builtins.zig's Diff is its one registration (its doc, traits and `run = hunks.word`); the three open hooks a plumber's rules would replace are a call each, look.zig's `hunks.lookedAt` (a bare look at a .diff or .patch) and `hunks.lookedAtCommit` (a commit hash) and ninep/ctl.zig's `hunks.paged` (a +Pager filled with a diff), their conditions inside them; the diff language (diff.zig, syntax.zig's highlightDiff, look's diff-line address) stays where the languages are; code locality's far share 0.575 before and after (codeloc.py --compare); goldens unchanged
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index a72e7259..7bd586dc 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -718,17 +718,7 @@ pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfM panes.File.setContent(p, f, page.text); f.pager_spans = page.spans; f.saved_revision = f.revision; - // A diff paged (`git show`, difftui's patches): its hunks stacked in a - // +Diff in the +Pager's place, the +Pager closed. The keyboard stays - // where it was, as a page's. - if (f.pager_diff) { - const keyboard = p.view().active; - if (panes.Output.openDiff(p, id, f.path, f.content)) |hid| { - // ponytail: the text is gone with it; Diff on the +Diff says no such file. - p.removePane(id, hid) catch |err| p.reportError(id, "pager", err); - } else |_| {} - if (p.panes[keyboard] != null) p.view().active = keyboard; - } + if (f.pager_diff) @import("../hunks.zig").paged(p, id); } /// The editor's step: the text of /pager opens closed unread goes in. |
