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/main.zig | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index c7f1f960..03bed908 100644 --- a/src/main.zig +++ b/src/main.zig @@ -340,6 +340,21 @@ fn libcResult(rc: usize) c_int { return -1; } +fn parseCtrlKey(raw: []const u8) ?u21 { + var value = std.mem.trim(u8, raw, " \t\r\n"); + if (value.len >= 5 and std.ascii.eqlIgnoreCase(value[0..5], "ctrl-")) { + value = value[5..]; + } else if (value.len >= 5 and std.ascii.eqlIgnoreCase(value[0..5], "ctrl+")) { + value = value[5..]; + } else if (value.len == 2 and value[0] == '^') { + value = value[1..]; + } + if (value.len != 1) return null; + const c = std.ascii.toLower(value[0]); + if (c < 'a' or c > 'z' or c == 'c') return null; + return c; +} + // init.gpa, what the tui, gui and detached shells allocate from, is their // own fixed arena (memory.host) in a release build, spilling to libc's // malloc, and std.start's DebugAllocator in Debug. Zig 0.17's std.start @@ -1036,21 +1051,6 @@ fn crossAttach(init: std.process.Init, opts: pardes.Options, name: []const u8) n remoteAttach(init, opts, sock, name); } -fn parseCtrlKey(raw: []const u8) ?u21 { - var value = std.mem.trim(u8, raw, " \t\r\n"); - if (value.len >= 5 and std.ascii.eqlIgnoreCase(value[0..5], "ctrl-")) { - value = value[5..]; - } else if (value.len >= 5 and std.ascii.eqlIgnoreCase(value[0..5], "ctrl+")) { - value = value[5..]; - } else if (value.len == 2 and value[0] == '^') { - value = value[1..]; - } - if (value.len != 1) return null; - const c = std.ascii.toLower(value[0]); - if (c < 'a' or c > 'z' or c == 'c') return null; - return c; -} - /// Where Recent's file (0.24) and the store before it were kept: /// $XDG_STATE_HOME/pardes, else ~/.local/state/pardes. A state file that /// holds no Recent yet reads them once (Db.zig). -- cgit v1.3