summaryrefslogtreecommitdiff
path: root/core/normal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 22:24:29 -0300
committerGabriel Schneider <[email protected]>2026-11-24 22:24:29 -0300
commit89b3e7365bac28c4cd7d52d40c1786c01db5af52 (patch)
treedcc65675b340f4ba93bfcf8d4edd9c7a4d16dc6c /core/normal.zig
parentb44a129a8854483dbe45ce2bcfa09f33ccbd6e8c (diff)
downloadpardes-89b3e7365bac28c4cd7d52d40c1786c01db5af52.tar.gz
pardes-89b3e7365bac28c4cd7d52d40c1786c01db5af52.zip
body_layer: a motion root's level paints its targets in the gutter while it shows: `g` its first and last lines, the window's top and bottom and the last edit (`g e t b .`); `]` the next and `[` the previous function, paragraph, test, comment, change, diagnostic, type and argument (`f p T c g d t a`); browsing `m` unrolled on `a` or `i` tints the brackets' region around the caret (pick-ui SPEC §4.4, walk UI line F item 2): the keys are the level's own (bindings.level, each leaf's role), each target looked for in the rows shown alone and a target off them not painted (the tag's arrows of §15 not built): the tree objects through syntax.objectNext given the shown bytes (QueryCursor.setByteRange; the motion passes null), `]g` through jj.nextChange bounded to the shown lines (`most`; the motion unbounded), `]d` a binary search of the fed diagnostics, `]p` the shown lines, `g t`/`g b` normal.gotoWindow's rows; drawn into the body as the `gw` labels are (R3), never written; at rest one test of the view's tag state (TagState.hostOf); the tree is the one the motion reads (normal.fileTree, made once a revision), not painted while the Changes layer's lines are in the buffer; TEST: body_layer.zig "a motion root's level paints its targets in the gutter ..." (`]` p, `g` g e, `m` on i tinted, rest as before); core-test 1025/1192 (167 skipped), 0 failed, load 9
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/normal.zig')
-rw-r--r--core/normal.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/normal.zig b/core/normal.zig
index 2ec8a4da..ea2bbc31 100644
--- a/core/normal.zig
+++ b/core/normal.zig
@@ -249,7 +249,7 @@ fn objectJump(e: Editor, t: *Text, text: []const u8, range: modal.Selection, obj
const tree = nodeTree(e, t, text) orelse return;
var last = range;
for (0..count) |_| {
- const s = syntax.objectNext(tree.path, tree.root, tree.text, object, forward, tree.in(modal.selectionCursor(text, last))) orelse break;
+ const s = syntax.objectNext(tree.path, tree.root, tree.text, object, forward, tree.in(modal.selectionCursor(text, last)), null) orelse break;
const next: modal.Selection = .{ .anchor = tree.out(s.from, false), .head = tree.out(s.to, s.to > s.from) };
if (std.meta.eql(next, last)) break;
last = next;
@@ -1317,7 +1317,7 @@ fn executeNormalAction(p: *Pardes, t: *Text, a: modal.Normal.Action) edit.Error!
.view_scroll_down => if (t.what == .body) return t.scrollViewMove(p.settings.tab, text, range, 1),
.view_scroll_up => if (t.what == .body) return t.scrollViewMove(p.settings.tab, text, range, -1),
// The next and the previous of the changes this view shows (jj.zig).
- .goto_change => if (@import("jj.zig").nextChange(p, pane, @intCast(@max(0, t.cur_row)), a.forward)) |line|
+ .goto_change => if (@import("jj.zig").nextChange(p, pane, @intCast(@max(0, t.cur_row)), a.forward, std.math.maxInt(usize))) |line|
return pointMove(p.settings.tab, t, text, range, modal.lineStartOffset(text, line)),
.goto_diagnostic, .goto_diagnostic_end => {
// Once a Diagnostics query fed them, the diagnostics are this