This commit is contained in:
Mitchell Hashimoto
2024-04-02 08:38:51 -07:00
parent 555f6e159f
commit eb2a2e3931
4 changed files with 8 additions and 8 deletions

View File

@ -26,7 +26,7 @@ pub inline fn copy(comptime T: type, dest: []T, source: []const T) void {
/// and a tmp var for the single rotated item instead of 3 calls to reverse. /// and a tmp var for the single rotated item instead of 3 calls to reverse.
pub inline fn rotateOnce(comptime T: type, items: []T) void { pub inline fn rotateOnce(comptime T: type, items: []T) void {
const tmp = items[0]; const tmp = items[0];
move(T, items[0..items.len - 1], items[1..items.len]); move(T, items[0 .. items.len - 1], items[1..items.len]);
items[items.len - 1] = tmp; items[items.len - 1] = tmp;
} }

View File

@ -91,7 +91,7 @@ pub fn main() !MainReturn {
\\ \\
\\We don't have proper help output yet, sorry! Please refer to the \\We don't have proper help output yet, sorry! Please refer to the
\\source code or Discord community for help for now. We'll fix this in time. \\source code or Discord community for help for now. We'll fix this in time.
\\ \\
, ,
.{}, .{},
); );

View File

@ -1331,8 +1331,8 @@ fn rowWillBeShifted(
// spacer head will be either moved or cleared, so we also need // spacer head will be either moved or cleared, so we also need
// to turn the spacer heads in to empty cells in that case. // to turn the spacer heads in to empty cells in that case.
if (self.scrolling_region.right == self.cols - 1 or if (self.scrolling_region.right == self.cols - 1 or
self.scrolling_region.left < 2 self.scrolling_region.left < 2)
) { {
const end_cell: *Cell = &cells[page.size.cols - 1]; const end_cell: *Cell = &cells[page.size.cols - 1];
if (end_cell.wide == .spacer_head) { if (end_cell.wide == .spacer_head) {
end_cell.wide = .narrow; end_cell.wide = .narrow;
@ -6318,7 +6318,7 @@ test "Terminal: deleteLines wide character spacer head left and right scroll mar
try t.printString("AAAAABBBB\u{1F600}CCC"); try t.printString("AAAAABBBB\u{1F600}CCC");
t.scrolling_region.right = 3; t.scrolling_region.right = 3;
t.scrolling_region.left = 2; t.scrolling_region.left = 2;
// Delete the top line // Delete the top line
// ## <- scrolling region // ## <- scrolling region
@ -6360,7 +6360,7 @@ test "Terminal: deleteLines wide character spacer head left (< 2) and right scro
try t.printString("AAAAABBBB\u{1F600}CCC"); try t.printString("AAAAABBBB\u{1F600}CCC");
t.scrolling_region.right = 3; t.scrolling_region.right = 3;
t.scrolling_region.left = 1; t.scrolling_region.left = 1;
// Delete the top line // Delete the top line
// ### <- scrolling region // ### <- scrolling region
@ -6400,7 +6400,7 @@ test "Terminal: deleteLines wide characters split by left/right scroll region bo
try t.printString("AAAAA\n\u{1F600}B\u{1F600}"); try t.printString("AAAAA\n\u{1F600}B\u{1F600}");
t.scrolling_region.right = 3; t.scrolling_region.right = 3;
t.scrolling_region.left = 1; t.scrolling_region.left = 1;
// Delete the top line // Delete the top line
// ### <- scrolling region // ### <- scrolling region

View File

@ -184,7 +184,7 @@ pub const Page = struct {
pub fn reinit(self: *Page) void { pub fn reinit(self: *Page) void {
// We zero the page memory as u64 instead of u8 because // We zero the page memory as u64 instead of u8 because
// we can and it's empirically quite a bit faster. // we can and it's empirically quite a bit faster.
@memset(@as([*]u64, @ptrCast(self.memory))[0..self.memory.len / 8], 0); @memset(@as([*]u64, @ptrCast(self.memory))[0 .. self.memory.len / 8], 0);
self.* = initBuf(OffsetBuf.init(self.memory), layout(self.capacity)); self.* = initBuf(OffsetBuf.init(self.memory), layout(self.capacity));
} }