From 2b04f877c29cf1e95c2fc8154de1da322c7299a3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 05:49:29 -0300 Subject: edit: the routing of a text's characters takes the editing context (docs/next-editor.md, R2, first slice): flatSurface, editText, editTextEol, setEditText, setEditTextEnd, setEditTextSpan, paneCursorLines, paneByteAtDisplay, pinPaneCursor, paneWrapWidth, treeIndent, pushUndo, undoStep, stepOwn, selText and vselText take `e: Editor` where they took `*Pardes`, the pane they route to reached through `e.p`; 149 calls in 16 files hand `p.editor()`, nothing else changes; core-test 810 of 949, shell-test 989 of 992, hxdiff 658 / parity 738 / hxgolf 124 with 0 mismatches, replicas pass --- src/tagline.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tagline.zig') diff --git a/src/tagline.zig b/src/tagline.zig index 1bb4dc85..84cb3173 100644 --- a/src/tagline.zig +++ b/src/tagline.zig @@ -90,7 +90,7 @@ pub fn revealHeader(p: *Pardes) void { v.header_top = 0; return; }; - const text = edit.flatSurface(p, t) catch |err| return p.reportError(v.active, "tag", err); + const text = edit.flatSurface(p.editor(), t) catch |err| return p.reportError(v.active, "tag", err); const cur: usize = @intCast(@max(0, t.cur_row)); const rows: usize = if (p.headerColumn() != null) layout.columnBarHeight(p) else p.topBarHeight(); if (cur < v.header_top) v.header_top = cur; @@ -424,7 +424,7 @@ pub fn enterHeader(p: *Pardes, column: ?usize) void { p.view().header = if (column) |c| .{ .column = c } else .workspace; if (column) |c| p.setActiveColumn(c); const t = focusedHeader(p) orelse return exitHeader(p); - takeKeyboard(t, edit.flatSurface(p, t) catch |err| return p.reportError(p.view().active, "tag", err)); + takeKeyboard(t, edit.flatSurface(p.editor(), t) catch |err| return p.reportError(p.view().active, "tag", err)); } /// The span a header's selection covers on line `row` of its text, in @@ -452,7 +452,7 @@ pub fn workspaceBlank(p: *Pardes, col: u16, row: u16, tag_hit: ?pardes.TagHit) b const v = p.view(); if (row >= p.topBarHeight() or col >= v.screen_w) return false; if (col < TAG_TEXT_INSET) return true; - const text = edit.flatSurface(p, &p.global_tag) catch return false; + const text = edit.flatSurface(p.editor(), &p.global_tag) catch return false; const scroll: usize = if (v.header != null and p.headerColumn() == null) v.header_scroll else 0; const at = @as(usize, Layer.columnAt(p, .workspace, 0, tag_hit, false, 0) orelse (col - TAG_TEXT_INSET)) + scroll; return at >= panes.File.displayWidth(modal.lineSlice(text, 0)) + 2; -- cgit v1.3