summaryrefslogtreecommitdiff
path: root/src/syntax.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-09 02:14:21 -0300
committerGabriel Schneider <[email protected]>2026-11-09 02:21:58 -0300
commitbfb74e76ef7dfe305a26010edc86dac456034c3e (patch)
treec90744aa2e0edf37c8e6cbc0033476230a086412 /src/syntax.zig
parentc78d362fa20393621ac198861f891439f9d832e9 (diff)
downloadpardes-bfb74e76ef7dfe305a26010edc86dac456034c3e.tar.gz
pardes-bfb74e76ef7dfe305a26010edc86dac456034c3e.zip
locality: single-caller helpers beside their caller: File's placeOf and restoreName beside undoStep, Query's row makers (clearPlaces, makeAllRows, makeNameRows, feedGrepPlaces) beside produce, look's helpers beside lookAt, lookSpanIn and lookUnresolved, mouse's beside handleMouse and dragUpdate, normal's beside handleNormal and executeNormalAction, and the rest in Core, draw, exec, layout, main, modal, replica, syntax, terminal; Messages.printRight into draw.zig beside joinNotice and edit.spanHas into exec.zig beside operandAt, their only callers
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/syntax.zig')
-rw-r--r--src/syntax.zig15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/syntax.zig b/src/syntax.zig
index 08b26096..96af9fa7 100644
--- a/src/syntax.zig
+++ b/src/syntax.zig
@@ -241,13 +241,6 @@ fn forExt(ext: []const u8) !?Selected {
return null;
}
-fn forLang(name: []const u8) !?Selected {
- const canonical = if (grammar_manifest.byName(name)) |i| grammar_manifest.all[i].name else name;
- for (&specs) |*spec| {
- if (std.ascii.eqlIgnoreCase(canonical, spec.name)) return try ensure(spec);
- }
- return null;
-}
fn runQuery(styles: []u8, sel: Selected, tree: *ts.Tree, base: usize) void {
const cursor = sel.cursor;
cursor.exec(sel.query, tree.rootNode());
@@ -938,6 +931,14 @@ fn codeAfterLocation(line: []const u8) ?struct { path: []const u8, at: usize, te
return .{ .path = target.path, .at = at, .text = line[at..] };
}
+fn forLang(name: []const u8) !?Selected {
+ const canonical = if (grammar_manifest.byName(name)) |i| grammar_manifest.all[i].name else name;
+ for (&specs) |*spec| {
+ if (std.ascii.eqlIgnoreCase(canonical, spec.name)) return try ensure(spec);
+ }
+ return null;
+}
+
fn inject(styles: []u8, source: []const u8, node: ts.Node, markdown: bool) void {
const kind = node.kind();
if (markdown and std.mem.eql(u8, kind, "inline")) {