From 3b31e0484bd06658f10cd9165b76cb1ca3b198bd Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 00:20:16 -0300 Subject: modal, normal, pdf_view, Text, syntax, edit: one key layer: an Action is the role the key named and what it was given (a count, a literal, ] or [), not a second union of sixteen sub-enums the roles were mapped onto one if at a time; a context's roles are tried in their enum order, the pending prefix and m sub-key are roles too, the text's executor and the PDF's switch flat on the role, and pdf_view.applyNormal(core, pane, action) does what a page cannot (Last, the leader, the tag, a search) instead of handing a seven-value enum back; no key does anything new; Text.normal's walked shape changes (wire semantics); helix-keys.md says how the keys are read Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/syntax.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/syntax.zig') diff --git a/src/syntax.zig b/src/syntax.zig index 1787335e..a498357c 100644 --- a/src/syntax.zig +++ b/src/syntax.zig @@ -436,9 +436,9 @@ pub fn walkNodes(tree_ptr: *anyopaque, walk: NodeWalk, from: usize, to: usize, a const tree: *const ts.Tree = @ptrCast(@alignCast(tree_ptr)); const lo: u32 = @intCast(@min(from, std.math.maxInt(u32))); const hi: u32 = @intCast(@min(to, std.math.maxInt(u32))); - if (walk == .parent_end or walk == .parent_start) { + if (walk == .parent_node_end or walk == .parent_node_start) { var node = tree.rootNode().namedDescendantForByteRange(lo, hi) orelse return 0; - if (walk == .parent_end) { + if (walk == .parent_node_end) { out[0] = .{ .from = node.endByte(), .to = node.endByte() }; return 1; } @@ -462,10 +462,10 @@ pub fn walkNodes(tree_ptr: *anyopaque, walk: NodeWalk, from: usize, to: usize, a if (cursor.gotoFirstChildForByte(lo) == null) break; } switch (walk) { - .expand => while (cursor.node().startByte() == lo and cursor.node().endByte() == hi) { + .expand_node => while (cursor.node().startByte() == lo and cursor.node().endByte() == hi) { if (!cursor.gotoParent()) break; }, - .shrink => _ = cursor.gotoFirstChild(), + .shrink_node => _ = cursor.gotoFirstChild(), .next_sibling => while (!cursor.gotoNextSibling()) { if (!cursor.gotoParent()) break; }, @@ -492,7 +492,7 @@ pub fn walkNodes(tree_ptr: *anyopaque, walk: NodeWalk, from: usize, to: usize, a } return n; }, - .parent_end, .parent_start => unreachable, + .parent_node_end, .parent_node_start => unreachable, } const node = cursor.node(); out[0] = .{ .from = node.startByte(), .to = node.endByte() }; -- cgit v1.3