renderer: remove alt-screen extend-always

This commit is contained in:
Mitchell Hashimoto
2024-08-10 10:39:10 -07:00
parent 9f06e74353
commit f7f8c655df
2 changed files with 12 additions and 16 deletions

View File

@ -2118,6 +2118,8 @@ fn rebuildCells(
// std.log.warn("[rebuildCells time] {}\t{}", .{start_micro, end.since(start) / std.time.ns_per_us}); // std.log.warn("[rebuildCells time] {}\t{}", .{start_micro, end.since(start) / std.time.ns_per_us});
// } // }
_ = screen_type; // we might use this again later so not deleting it yet
// Create an arena for all our temporary allocations while rebuilding // Create an arena for all our temporary allocations while rebuilding
var arena = ArenaAllocator.init(self.alloc); var arena = ArenaAllocator.init(self.alloc);
defer arena.deinit(); defer arena.deinit();
@ -2154,12 +2156,9 @@ fn rebuildCells(
switch (self.config.padding_color) { switch (self.config.padding_color) {
.background => {}, .background => {},
.extend => { // For extension, assume we are extending in all directions.
self.uniforms.padding_extend.up = screen_type == .alternate; // For "extend" this may be disabled due to heuristics below.
self.uniforms.padding_extend.down = screen_type == .alternate; .extend, .@"extend-always" => {
},
.@"extend-always" => {
self.uniforms.padding_extend = .{ self.uniforms.padding_extend = .{
.up = true, .up = true,
.down = true, .down = true,
@ -2209,9 +2208,9 @@ fn rebuildCells(
.background, .@"extend-always" => {}, .background, .@"extend-always" => {},
// Apply heuristics for padding extension. // Apply heuristics for padding extension.
.extend => if (y == 0 and screen_type == .primary) { .extend => if (y == 0) {
self.uniforms.padding_extend.up = !row.neverExtendBg(); self.uniforms.padding_extend.up = !row.neverExtendBg();
} else if (y == self.cells.size.rows - 1 and screen_type == .primary) { } else if (y == self.cells.size.rows - 1) {
self.uniforms.padding_extend.down = !row.neverExtendBg(); self.uniforms.padding_extend.down = !row.neverExtendBg();
}, },
} }

View File

@ -1172,6 +1172,8 @@ pub fn rebuildCells(
cursor_style_: ?renderer.CursorStyle, cursor_style_: ?renderer.CursorStyle,
color_palette: *const terminal.color.Palette, color_palette: *const terminal.color.Palette,
) !void { ) !void {
_ = screen_type;
// Bg cells at most will need space for the visible screen size // Bg cells at most will need space for the visible screen size
self.cells_bg.clearRetainingCapacity(); self.cells_bg.clearRetainingCapacity();
self.cells.clearRetainingCapacity(); self.cells.clearRetainingCapacity();
@ -1216,12 +1218,7 @@ pub fn rebuildCells(
switch (self.config.padding_color) { switch (self.config.padding_color) {
.background => {}, .background => {},
.extend => { .extend, .@"extend-always" => {
self.padding_extend_top = screen_type == .alternate;
self.padding_extend_bottom = screen_type == .alternate;
},
.@"extend-always" => {
self.padding_extend_top = true; self.padding_extend_top = true;
self.padding_extend_bottom = true; self.padding_extend_bottom = true;
}, },
@ -1283,9 +1280,9 @@ pub fn rebuildCells(
.background, .@"extend-always" => {}, .background, .@"extend-always" => {},
// Apply heuristics for padding extension. // Apply heuristics for padding extension.
.extend => if (y == 0 and screen_type == .primary) { .extend => if (y == 0) {
self.padding_extend_top = !row.neverExtendBg(); self.padding_extend_top = !row.neverExtendBg();
} else if (y == self.grid_size.rows - 1 and screen_type == .primary) { } else if (y == self.grid_size.rows - 1) {
self.padding_extend_bottom = !row.neverExtendBg(); self.padding_extend_bottom = !row.neverExtendBg();
}, },
} }