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/Messages.zig | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'src/Messages.zig') diff --git a/src/Messages.zig b/src/Messages.zig index 6913f99f..f5767857 100644 --- a/src/Messages.zig +++ b/src/Messages.zig @@ -7,8 +7,6 @@ const std = @import("std"); const layout = @import("layout.zig"); const ctlfs = @import("ninep/tree.zig"); const panes = @import("panes.zig"); -const CellStyle = @import("surface.zig").CellStyle; -const Surface = @import("surface.zig").Surface; const limits = memory.limits; const config = @import("config.zig"); const platform = pardes.platform; @@ -60,33 +58,6 @@ fn leaderText(p: *const Pardes, buf: *[16]u8) []const u8 { return buf[0..end]; } -const Printed = struct { left: u16, dropped: usize }; - -/// Prints `text` flush with the right edge of the band, and answers the -/// column it started at so a cursor can follow it. Text wider than the -/// band loses its HEAD: the end is the part that says something -- a -/// path's file name, an error's reason -- and `dropped` is how many -/// columns of it went. -pub fn printRight(s: *Surface, x: u16, row: u16, w: u16, text: []const u8, style: CellStyle) Printed { - const width = panes.File.displayWidth(text); - if (width <= w) { - const left: u16 = @intCast(x + w - width); - _ = s.print(left, row, @intCast(width), text, style); - return .{ .left = left, .dropped = 0 }; - } - // Whole glyphs only: a cut inside a wide one would leave the rest a - // column too wide and clip its LAST glyph instead of the first. - var dropped = width - w; - var start = panes.File.rawAtDisplay(text, dropped); - if (panes.File.rawDisplayCol(text, start) < dropped) { - dropped += 1; - start = panes.File.rawAtDisplay(text, dropped); - } - const left: u16 = @intCast(x + w - (width - dropped)); - _ = s.print(left, row, @intCast(width - dropped), text[start..], style); - return .{ .left = left, .dropped = dropped }; -} - pub const Message = struct { const libc = std.c; const Tm = extern struct { -- cgit v1.3