summaryrefslogtreecommitdiff
path: root/src/syntax.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 00:20:16 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:17:28 -0300
commit3b31e0484bd06658f10cd9165b76cb1ca3b198bd (patch)
treed12169502b6b3a5b38be989ca4f0afd9e78a7ebd /src/syntax.zig
parent26649273cc253319fdd833923928aa883e3f884c (diff)
downloadpardes-3b31e0484bd06658f10cd9165b76cb1ca3b198bd.tar.gz
pardes-3b31e0484bd06658f10cd9165b76cb1ca3b198bd.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/syntax.zig')
-rw-r--r--src/syntax.zig10
1 files changed, 5 insertions, 5 deletions
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() };