diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 01:43:24 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 01:43:40 -0300 |
| commit | ed05c825102ebce7cd1e314226a1c88b8658baef (patch) | |
| tree | 41957f9fb7c5df11389d7872079c6494f47af5ce /core/mouse.zig | |
| parent | 0252c830daf6184a9faefa32a7d1f384f5a86b94 (diff) | |
| parent | 59b6ac1bae9cb6720252e1c3e1cc9d4f3a8ab3b1 (diff) | |
| download | pardes-ed05c825102ebce7cd1e314226a1c88b8658baef.tar.gz pardes-ed05c825102ebce7cd1e314226a1c88b8658baef.zip | |
integration: the tree to install next: a view scrolls by ROWS: `main` (pardes-merge66, 0252c830daf6, installed 2026-11-24 01:22) and pardes-row-scroll-3 (`wkxsvmun` on `kyntorlp`, `rymstysv`, `qwssppvo`, on pardes-merge65: a view's top is (line, row within the line's own wrapped rows): a notch is one row through a wrapped line and a wrapped description of the layer, the margin, PageDown/PageUp, `gt`/`gb`, `gw`, `blankRows` and a Look's centring count rows; the wire 35); no conflict; REMOVED HERE: `core/walk.zig.orig`, a patch's leftover that `pvwuwnlk` had added; EXPECTED in its gate and ruled: corpus frame 76 differs (the margin counts rows: the new picture stands) and ten perf counts over tree7 (P85: the view now draws the rows the cursor is on in a wrapped line: deep-sel; the cursor's row found in long lines); its gate: .scratch/sketch/reorg/merge67, the numbers in PARDES.md
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/mouse.zig')
| -rw-r--r-- | core/mouse.zig | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/mouse.zig b/core/mouse.zig index 2d731acf..14700995 100644 --- a/core/mouse.zig +++ b/core/mouse.zig @@ -702,7 +702,7 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void { const id = hovered orelse return; const pane = p.panes[id].?; if (!programWheel(p, id, m, mcol, mrow)) - pane.scrollBy(if (m.button == .wheel_up) -config.wheel_rows else config.wheel_rows); + pane.scrollBy(p.settings.tab, if (m.button == .wheel_up) -config.wheel_rows else config.wheel_rows); }, .wheel_left, .wheel_right => { if (m.kind != .press) return; @@ -779,7 +779,7 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void { return pane.places.goTo(p.settings.tab, pane, i, false); }; // gutter scrollbar: a left click scrolls UP to that row - pane.scrollBy(-(@as(i32, mrow) - @as(i32, body_y))); + pane.scrollBy(p.settings.tab, -(@as(i32, mrow) - @as(i32, body_y))); } else { const on_tag = mrow >= tag_y and mrow < tag_y + pane.tag_rows; if (on_tag and mcol < r.x + TAG_TEXT_INSET) return; @@ -847,7 +847,7 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void { if (mcol < r.x + config.GUTTER and !on_tag) { const local = @as(i32, mrow) - @as(i32, body_y); if (m.button == config.look_button) v.active = id; - pane.scrollBy(if (m.button == config.look_button) local else -local); + pane.scrollBy(p.settings.tab, if (m.button == config.look_button) local else -local); } else if (edit.pointerTextSelection(p, id, mcol, mrow, m.body_hit, v.pointer_tag_hit)) |pointed| { if (m.button == config.look_button) v.active = id; pane.clearPointerSelection(@backingInt(m.button)); @@ -1150,11 +1150,15 @@ pub fn edgeScroll(p: *Pardes) void { const sl = &pane.sel[sel_slot]; if (s.anchor == null) s.anchor = sweepPoint(p, pane, sl.r0, sl.c0) orelse return; const before = pane.scroll(); - pane.scrollBy(s.edge); + // A file's view moves by rows (File.Top), a terminal's rows are lines. + const moved: i64 = if (pane.file != null) panes.File.scrollRows(p.settings.tab, pane, s.edge) else blk: { + pane.scrollBy(p.settings.tab, s.edge); + break :blk pane.scroll() - before; + }; // The start's row follows its text while it is on the screen, and // stays on the body's edge row once it is off (the anchor keeps it). const top: i32 = pane.tag_rows; - sl.r0 = std.math.clamp(sl.r0 - (pane.scroll() - before), top, top + @as(i32, pane.rows) - 1); + sl.r0 = std.math.clamp(sl.r0 - @as(i32, @intCast(moved)), top, top + @as(i32, pane.rows) - 1); } /// The text position under a body cell of the sweep's space. |
