summaryrefslogtreecommitdiff
path: root/core/Places.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 01:43:24 -0300
committerGabriel Schneider <[email protected]>2026-11-24 01:43:40 -0300
commited05c825102ebce7cd1e314226a1c88b8658baef (patch)
tree41957f9fb7c5df11389d7872079c6494f47af5ce /core/Places.zig
parent0252c830daf6184a9faefa32a7d1f384f5a86b94 (diff)
parent59b6ac1bae9cb6720252e1c3e1cc9d4f3a8ab3b1 (diff)
downloadpardes-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/Places.zig')
-rw-r--r--core/Places.zig11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/Places.zig b/core/Places.zig
index 1c24e992..6c3ac9ab 100644
--- a/core/Places.zig
+++ b/core/Places.zig
@@ -561,9 +561,12 @@ pub fn goTo(set: *Places, tab: u16, pane: *Pane, i: usize, add: bool) void {
}
set.current = i;
set.gen +%= 1;
- const off = pane.scroll();
- if (t.cur_row < off or t.cur_row >= off + @as(i32, pane.rows))
- pane.scrollBy(t.cur_row - off - @divTrunc(@as(i32, pane.rows), 2));
+ // Off the view, its row half the body's rows down (as zz).
+ const line: usize = @intCast(@max(0, t.cur_row));
+ const row = panes.File.rowOf(tab, pane, line, @intCast(@max(0, t.cur_col)));
+ const body: i64 = panes.File.shownRows(tab, pane);
+ const on = if (panes.File.rowsTo(tab, pane, panes.File.top(tab, pane), line, @intCast(body))) |d| d + row else -1;
+ if (on < 0 or on >= body) panes.File.setTop(pane, panes.File.walkRows(tab, pane, .{ .line = line, .row = row }, -@divTrunc(body, 2)).to);
t.show(tab);
}
@@ -634,7 +637,7 @@ pub fn restore(set: *Places, tab: u16, pane: *Pane) void {
r.head = @min(r.head, f.content.len);
}
pane.body.setRanges(tab, f.content, set.snap, &.{}, set.snap_pri, set.snap_expl);
- f.scroll = set.snap_scroll;
+ panes.File.setTop(pane, .{ .line = set.snap_scroll });
f.syntax_dirty = true;
pane.hscroll = set.snap_hscroll;
}