replace nested if for readability

pull/7810/head
Daniel 2025-07-04 21:36:17 -04:00
parent 0b4a1e2154
commit 1a4b128af3
1 changed files with 8 additions and 9 deletions

View File

@ -145,15 +145,14 @@ pub const Contents = struct {
self.fg_rows.lists[0].clearRetainingCapacity();
self.fg_rows.lists[self.size.rows + 1].clearRetainingCapacity();
if (v) |cell| {
if (cursor_style) |style| {
switch (style) {
// Block cursors should be drawn first
.block => self.fg_rows.lists[0].appendAssumeCapacity(cell),
// Other cursor styles should be drawn last
.block_hollow, .bar, .underline, .lock => self.fg_rows.lists[self.size.rows + 1].appendAssumeCapacity(cell),
}
}
const cell = v orelse return;
const style = cursor_style orelse return;
switch (style) {
// Block cursors should be drawn first
.block => self.fg_rows.lists[0].appendAssumeCapacity(cell),
// Other cursor styles should be drawn last
.block_hollow, .bar, .underline, .lock => self.fg_rows.lists[self.size.rows + 1].appendAssumeCapacity(cell),
}
}