From bfb74e76ef7dfe305a26010edc86dac456034c3e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 9 Nov 2026 02:14:21 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/syntax.zig | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/syntax.zig') 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")) { -- cgit v1.3