mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
Merge pull request #2317 from jcollie/list-themes-window-too-narrow
cli: fix integer overflow in `+list-themes` if window is too narrow
This commit is contained in:
@ -1068,19 +1068,21 @@ const Preview = struct {
|
|||||||
.col_offset = 2,
|
.col_offset = 2,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
for (10..child.width) |col| {
|
if (child.width > 10) {
|
||||||
_ = try child.print(
|
for (10..child.width) |col| {
|
||||||
&.{
|
_ = try child.print(
|
||||||
.{
|
&.{
|
||||||
.text = "─",
|
.{
|
||||||
.style = color238,
|
.text = "─",
|
||||||
|
.style = color238,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
.{
|
||||||
.{
|
.row_offset = 1,
|
||||||
.row_offset = 1,
|
.col_offset = col,
|
||||||
.col_offset = col,
|
},
|
||||||
},
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ = try child.print(
|
_ = try child.print(
|
||||||
@ -1118,19 +1120,21 @@ const Preview = struct {
|
|||||||
.col_offset = 2,
|
.col_offset = 2,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
for (10..child.width) |col| {
|
if (child.width > 10) {
|
||||||
_ = try child.print(
|
for (10..child.width) |col| {
|
||||||
&.{
|
_ = try child.print(
|
||||||
.{
|
&.{
|
||||||
.text = "─",
|
.{
|
||||||
.style = color238,
|
.text = "─",
|
||||||
|
.style = color238,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
.{
|
||||||
.{
|
.row_offset = 3,
|
||||||
.row_offset = 3,
|
.col_offset = col,
|
||||||
.col_offset = col,
|
},
|
||||||
},
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ = try child.print(
|
_ = try child.print(
|
||||||
@ -1383,19 +1387,21 @@ const Preview = struct {
|
|||||||
.col_offset = 2,
|
.col_offset = 2,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
for (10..child.width) |col| {
|
if (child.width > 10) {
|
||||||
_ = try child.print(
|
for (10..child.width) |col| {
|
||||||
&.{
|
_ = try child.print(
|
||||||
.{
|
&.{
|
||||||
.text = "─",
|
.{
|
||||||
.style = color238,
|
.text = "─",
|
||||||
|
.style = color238,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
.{
|
||||||
.{
|
.row_offset = 21,
|
||||||
.row_offset = 21,
|
.col_offset = col,
|
||||||
.col_offset = col,
|
},
|
||||||
},
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ = try child.print(
|
_ = try child.print(
|
||||||
|
Reference in New Issue
Block a user