From eb2a2e39317529d41055a952bee7c462fa2dc6e5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 2 Apr 2024 08:38:51 -0700 Subject: [PATCH] fmt --- src/fastmem.zig | 2 +- src/main_ghostty.zig | 2 +- src/terminal/Terminal.zig | 10 +++++----- src/terminal/page.zig | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/fastmem.zig b/src/fastmem.zig index 8f32bc3c8..53c9e1122 100644 --- a/src/fastmem.zig +++ b/src/fastmem.zig @@ -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. pub inline fn rotateOnce(comptime T: type, items: []T) void { 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; } diff --git a/src/main_ghostty.zig b/src/main_ghostty.zig index 32458ada9..17c521d1e 100644 --- a/src/main_ghostty.zig +++ b/src/main_ghostty.zig @@ -91,7 +91,7 @@ pub fn main() !MainReturn { \\ \\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. - \\ + \\ , .{}, ); diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index d002b47ec..e29a4003d 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -1331,8 +1331,8 @@ fn rowWillBeShifted( // spacer head will be either moved or cleared, so we also need // to turn the spacer heads in to empty cells in that case. 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]; if (end_cell.wide == .spacer_head) { 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"); t.scrolling_region.right = 3; - t.scrolling_region.left = 2; + t.scrolling_region.left = 2; // Delete the top line // ## <- 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"); t.scrolling_region.right = 3; - t.scrolling_region.left = 1; + t.scrolling_region.left = 1; // Delete the top line // ### <- 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}"); t.scrolling_region.right = 3; - t.scrolling_region.left = 1; + t.scrolling_region.left = 1; // Delete the top line // ### <- scrolling region diff --git a/src/terminal/page.zig b/src/terminal/page.zig index d100acc89..e70695213 100644 --- a/src/terminal/page.zig +++ b/src/terminal/page.zig @@ -184,7 +184,7 @@ pub const Page = struct { pub fn reinit(self: *Page) void { // We zero the page memory as u64 instead of u8 because // 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)); }