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/modal.zig | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/modal.zig') diff --git a/src/modal.zig b/src/modal.zig index 6f0bdc9c..f540b1a7 100644 --- a/src/modal.zig +++ b/src/modal.zig @@ -526,29 +526,6 @@ pub fn isUnicodeWhitespace(cp: u21) bool { }; } -/// A codepoint's word class: Unicode word characters, punctuation, or -/// whitespace (line ends included; wordClassAt tells them apart). -fn kindOfCodepoint(cp: u21) WordClass { - if (isUnicodeWhitespace(cp)) return .ws; - if (cp == '_') return .word; - return switch (uucode.get(.general_category, cp)) { - .letter_uppercase, - .letter_lowercase, - .letter_titlecase, - .letter_modifier, - .letter_other, - .mark_nonspacing, - .mark_spacing_combining, - .mark_enclosing, - .number_decimal_digit, - .number_letter, - .number_other, - .punctuation_connector, - => .word, - else => .punct, - }; -} - fn lineLenOf(lines: []const []const u8, row: usize) usize { if (row >= lines.len) return 0; return lines[row].len; @@ -1042,6 +1019,29 @@ pub const WordTarget = enum { // that distinction is load-bearing in reached_target. const WordClass = enum { word, punct, ws, eol }; +/// A codepoint's word class: Unicode word characters, punctuation, or +/// whitespace (line ends included; wordClassAt tells them apart). +fn kindOfCodepoint(cp: u21) WordClass { + if (isUnicodeWhitespace(cp)) return .ws; + if (cp == '_') return .word; + return switch (uucode.get(.general_category, cp)) { + .letter_uppercase, + .letter_lowercase, + .letter_titlecase, + .letter_modifier, + .letter_other, + .mark_nonspacing, + .mark_spacing_combining, + .mark_enclosing, + .number_decimal_digit, + .number_letter, + .number_other, + .punctuation_connector, + => .word, + else => .punct, + }; +} + fn wordClassAt(text: []const u8, off: usize) WordClass { if (off >= text.len) return .eol; const cp = codepointAt(text, off); -- cgit v1.3