diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-09 02:14:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-09 02:21:58 -0300 |
| commit | bfb74e76ef7dfe305a26010edc86dac456034c3e (patch) | |
| tree | c90744aa2e0edf37c8e6cbc0033476230a086412 /src/Messages.zig | |
| parent | c78d362fa20393621ac198861f891439f9d832e9 (diff) | |
| download | pardes-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/Messages.zig')
| -rw-r--r-- | src/Messages.zig | 29 |
1 files changed, 0 insertions, 29 deletions
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 { |
