╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Files.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1052 const ellipsis = ".."; 1053 var iter = (try std.unicode.Utf8View.init(dir)).iterator(); 1054 var start: usize = 0; 1055 while (width > max_width - ellipsis.len) { 1056 const slice = iter.nextCodepointSlice() orelse break; 1057 width -= xitui.width.cellWidth(try std.unicode.utf8Decode(slice)); 1058 start += slice.len; 1059 } 1060 return std.fmt.allocPrint(aa, " " ++ ellipsis ++ "{s} ", .{dir[start..]}); 1061 } 1062