╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Files.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
1103 1104 const ellipsis = ".."; 1105 var iter = (try std.unicode.Utf8View.init(dir)).iterator(); 1106 var start: usize = 0; 1107 while (width > max_width - ellipsis.len) { 1108 const slice = iter.nextCodepointSlice() orelse break; 1109 width -= xitui.width.cellWidth(try std.unicode.utf8Decode(slice)); 1110 start += slice.len; 1111 } 1112 return aa.print(" " ++ ellipsis ++ "{s} ", .{dir[start..]}); 1113 } 1114