config: clarify padding color default

This commit is contained in:
Mitchell Hashimoto
2024-08-10 10:27:59 -07:00
parent aeb3b64110
commit 40b3d4c72e
2 changed files with 21 additions and 13 deletions

View File

@ -712,10 +712,9 @@ keybind: Keybinds = .{},
/// * The nearest row is a prompt row (requires shell integration). The
/// thinking here is that prompts often contain powerline glyphs that
/// do not look good extended.
/// * The nearest row contains a perfect fit powerline character. These
/// don't look good extended.
///
/// The default value is "extend". This allows for smooth resizing of a
/// terminal grid without having visible empty areas around the edge. The edge
/// cells may appear slightly larger due to the extension.
@"window-padding-color": WindowPaddingColor = .background,
/// Synchronize rendering with the screen refresh rate. If true, this will

View File

@ -1955,13 +1955,19 @@ pub fn setScreenSize(
}).add(padding);
var padding_extend = self.uniforms.padding_extend;
if (self.config.padding_color == .extend) {
// If padding extension is enabled, we extend left and right always.
switch (self.config.padding_color) {
.extend => {
// If padding extension is enabled, we extend left and right always
// because there is no downside to this. Up/down is dependent
// on some heuristics (see rebuildCells).
padding_extend.left = true;
padding_extend.right = true;
} else {
},
else => {
// Otherwise, disable all padding extension.
padding_extend = .{};
},
}
// Set the size of the drawable surface to the bounds
@ -2138,9 +2144,12 @@ fn rebuildCells(
self.cells.reset();
// We also reset our padding extension depending on the screen type
if (self.config.padding_color == .extend) {
switch (self.config.padding_color) {
.background => {},
.extend => {
self.uniforms.padding_extend.up = screen_type == .alternate;
self.uniforms.padding_extend.down = screen_type == .alternate;
},
}
}