From abde2b9e1869c378dd5bf1d04c4f7a87dda1d8f5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 5 Aug 2022 11:21:37 -0700 Subject: [PATCH] way easier way to slice to end of storage duh --- src/terminal/Screen.zig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 58c73918b..b828898b1 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -503,13 +503,9 @@ fn selectionSlices(self: Screen, sel: Selection) struct { // The bottom and top are split into two slices, so we slice to the // bottom of the storage, then from the top. - - // This the last row in the storage area, which is the total rows - // in the full storage minus the top offset minus 1 (due to 0-index). - const storage_bot = self.rowIndex(self.totalRows() - self.top - 1); return .{ .top_offset = sel_top.x, - .top = self.storage[top + sel_top.x .. storage_bot + self.cols], + .top = self.storage[top + sel_top.x .. self.storage.len], .bot = self.storage[0 .. bot + sel_bot.x + 1], }; }