custom_bind_width nullable, defaulting to screen width

This commit is contained in:
RadsammyT 2026-03-27 02:56:58 -04:00
commit b8105b113d
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -37,7 +37,7 @@ cmatrix_max_codepoint: u16 = 0x7B,
colormix_col1: u32 = 0x00FF0000,
colormix_col2: u32 = 0x000000FF,
colormix_col3: u32 = 0x20000000,
custom_bind_width: u32 = 0,
custom_bind_width: ?u32 = null,
custom_sessions: []const u8 = build_options.config_directory ++ "/ly/custom-sessions",
default_input: Input = .login,
doom_fire_height: u8 = 6,

View file

@ -1899,7 +1899,7 @@ fn positionWidgets(ptr: *anyopaque) !void {
.addY(y_offset)
.addX(x_offset));
x_offset += item.lbl.text.len + 1;
if (x_offset > state.config.custom_bind_width) {
if (x_offset + item.lbl.text.len > state.config.custom_bind_width orelse state.buffer.width) {
x_offset = 0;
y_offset += 1;
}