summaryrefslogtreecommitdiff
path: root/src/Messages.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Messages.zig')
-rw-r--r--src/Messages.zig29
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 {