summaryrefslogtreecommitdiff
path: root/core/mouse.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-23 11:37:50 -0300
committerGabriel Schneider <[email protected]>2026-11-23 11:54:56 -0300
commit2da0bb429eb5667acc8be70f81196dbc8d47187f (patch)
tree96014f22f97d32cb11cb77710a55c7fec6fd99c3 /core/mouse.zig
parentd4445d6d818e829a944a6ee37c43b7c5f1178237 (diff)
downloadpardes-2da0bb429eb5667acc8be70f81196dbc8d47187f.tar.gz
pardes-2da0bb429eb5667acc8be70f81196dbc8d47187f.zip
changes layer: a Look on a jj change's id opens its patch, its header and whole message at the top, and a Look on a ghost row looks at its word as anywhere (the user's rulings of 2026-11-23: all text is text; a patch of one change opens with its metadata): a word of k to z letters had no meaning to a Look (searched), `Diff` took only a git hash, and a B3 on a ghost row was a button of its own (`lookGhost` opened the line in the revision it came from); now `Diff <change> [path[:line]]` (core/jj.zig `diffChange`, from hunks.zig's word) runs `jj show --git -r change_id(<change>)` in the pane's repository (on the tape, as `At`'s `jj file show`), stacks it in the change's own `+Diff-<commit>` with jj's header above the hunks (Commit ID, Change ID, Author, Committer, the whole message) and puts the cursor on `path`'s row for `line` (that file's first row without one, the top without a place; a second Look moves the open one); a plumbing rule sends a change id looked at in any pane (eight to thirty-two letters k to z, as `jj log` writes them: four would name a change by accident too often) to `Diff`, which declines a word that names no change, so it is searched as before; a B3 on a ghost row looks at the word under it (`wordAt`, then the regular `look.lookAt`), and on a description's id runs `Diff <id> <path>:<line>` with the line of that change's last hunk in this file, the text a user could type; tests: "a Look on a change's id opens its patch ..." (B3 on mid's description id in a terminal and a window: a `+Diff-` pane, its first lines jj's header, ` mid` in it, the cursor on a.zig:4; the same typed with a.zig:2; `Look <cut's id>` from the file: cut's patch at its top; `Look zzzzzzzz`: no patch), the ghost-row test's Look now asserts a B3 on `c();`'s ghost row is what `Look c` does (no revision opens), and hunks.zig's "a log of several changes keeps each one's header and whole message above its own hunks" (git log -p: each commit's header above its own hunks: it passed on the base: the format keeps them); core-test 927/1091 (164 skipped), shell-test 1133/1136 (3 skipped)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/mouse.zig')
-rw-r--r--core/mouse.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/mouse.zig b/core/mouse.zig
index 91d2932c..7c9007a1 100644
--- a/core/mouse.zig
+++ b/core/mouse.zig
@@ -1250,10 +1250,10 @@ fn dragRelease(p: *Pardes, button: Mouse.Button) void {
}
} else {
const clk = pane.sel[b];
- // A right-click on a ghost row (jj.zig) looks at its line
- // in the revision it came from.
+ // A right-click on a ghost row (jj.zig) looks at the word
+ // there, as anywhere.
if (s.button == config.look_button and clk.r0 >= pane.tag_rows and clk.r0 == clk.r1 and clk.c0 == clk.c1 and
- pane.layers.lanes > 0 and @import("jj.zig").lookGhost(p, s.id, clk.r0 - pane.tag_rows))
+ pane.layers.lanes > 0 and @import("jj.zig").lookGhost(p, s.id, clk.r0 - pane.tag_rows, clk.c0))
{
pane.sel[b].state = .none;
return;