mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
replace nested if for readability
This commit is contained in:
@ -145,15 +145,14 @@ pub const Contents = struct {
|
|||||||
self.fg_rows.lists[0].clearRetainingCapacity();
|
self.fg_rows.lists[0].clearRetainingCapacity();
|
||||||
self.fg_rows.lists[self.size.rows + 1].clearRetainingCapacity();
|
self.fg_rows.lists[self.size.rows + 1].clearRetainingCapacity();
|
||||||
|
|
||||||
if (v) |cell| {
|
const cell = v orelse return;
|
||||||
if (cursor_style) |style| {
|
const style = cursor_style orelse return;
|
||||||
switch (style) {
|
|
||||||
// Block cursors should be drawn first
|
switch (style) {
|
||||||
.block => self.fg_rows.lists[0].appendAssumeCapacity(cell),
|
// Block cursors should be drawn first
|
||||||
// Other cursor styles should be drawn last
|
.block => self.fg_rows.lists[0].appendAssumeCapacity(cell),
|
||||||
.block_hollow, .bar, .underline, .lock => self.fg_rows.lists[self.size.rows + 1].appendAssumeCapacity(cell),
|
// Other cursor styles should be drawn last
|
||||||
}
|
.block_hollow, .bar, .underline, .lock => self.fg_rows.lists[self.size.rows + 1].appendAssumeCapacity(cell),
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user