| author | |
| committer | |
| log | 2f19992cb1802893315bd70ce050a53808b04ea5 |
| tree | 7a1797a93095cf82d9567b6d61f5f7af0977bfcd |
| parent | d1c2ebf3f6c9b0d3aaa74a123d2f0a5657242431 |
| signature |
2 files changed, 7 insertions(+), 5 deletions(-)
README.md+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | [](https://github.com/nektro/zig-ansi/blob/master/LICENSE) |
| 5 | 5 | [](https://discord.gg/P6Y4zQC) |
| 6 | 6 | [](https://github.com/sponsors/nektro) |
| 7 | [](https://ziglang.org/) | |
| 7 | [](https://ziglang.org/) | |
| 8 | 8 | [](https://github.com/nektro/zigmod) |
| 9 | 9 | |
| 10 | 10 | ANSI utilities for CLI usage in Zig. |
src/lib.zig+6-4| ... | ... | @@ -58,11 +58,13 @@ fn make_csi_sequence(comptime c: []const u8, comptime x: anytype) []const u8 { |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | fn arr_i_to_s(x: anytype) [][]const u8 { |
| 61 | var res: [x.len][]const u8 = undefined; | |
| 62 | for (x, 0..) |item, i| { | |
| 63 | res[i] = std.fmt.comptimePrint("{}", .{item}); | |
| 61 | comptime { | |
| 62 | var res: [x.len][]const u8 = undefined; | |
| 63 | for (x, 0..) |item, i| { | |
| 64 | res[i] = std.fmt.comptimePrint("{}", .{item}); | |
| 65 | } | |
| 66 | return &res; | |
| 64 | 67 | } |
| 65 | return &res; | |
| 66 | 68 | } |
| 67 | 69 | |
| 68 | 70 | pub const csi = struct { |