From b0f99307d3f215a6d1949258d4d1b42fedcc0ba9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 4 Jul 2024 20:17:46 -0700 Subject: [PATCH] terminal: pause integrity checks in clone row until done --- src/terminal/page.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/terminal/page.zig b/src/terminal/page.zig index e807904df..7efd36408 100644 --- a/src/terminal/page.zig +++ b/src/terminal/page.zig @@ -616,6 +616,13 @@ pub const Page = struct { x_start: usize, x_end_req: usize, ) CloneFromError!void { + // This whole operation breaks integrity until the end. + self.pauseIntegrityChecks(true); + defer { + self.pauseIntegrityChecks(false); + self.assertIntegrity(); + } + const cell_len = @min(self.size.cols, other.size.cols); const x_end = @min(x_end_req, cell_len); assert(x_start <= x_end); @@ -715,9 +722,6 @@ pub const Page = struct { last.wide = .narrow; } } - - // The final page should remain consistent - self.assertIntegrity(); } /// Get a single row. y must be valid.