| ... | @@ -1,6 +1,5 @@ | ... | @@ -1,6 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const ansi = @import("ansi"); | 2 | const ansi = @import("ansi"); |
| 3 | const range = @import("range").range; | | |
| 4 | | 3 | |
| 5 | pub fn answer(out: anytype, comptime prompt: []const u8, comptime T: type, comptime valfmt: []const u8, value: T) !T { | 4 | pub fn answer(out: anytype, comptime prompt: []const u8, comptime T: type, comptime valfmt: []const u8, value: T) !T { |
| 6 | try out.print(comptime ansi.color.Fg(.Green, "? "), .{}); | 5 | try out.print(comptime ansi.color.Fg(.Green, "? "), .{}); |
| ... | @@ -35,7 +34,7 @@ fn doprompt(out: anytype, in: anytype, alloc: std.mem.Allocator, default: ?[]con | ... | @@ -35,7 +34,7 @@ fn doprompt(out: anytype, in: anytype, alloc: std.mem.Allocator, default: ?[]con |
| 35 | } | 34 | } |
| 36 | | 35 | |
| 37 | fn clean(out: anytype, n: usize) !void { | 36 | fn clean(out: anytype, n: usize) !void { |
| 38 | for (range(n)) |_| { | 37 | for (0..n) |_| { |
| 39 | try out.print(comptime ansi.csi.CursorUp(1), .{}); | 38 | try out.print(comptime ansi.csi.CursorUp(1), .{}); |
| 40 | try out.print(comptime ansi.csi.EraseInLine(0), .{}); | 39 | try out.print(comptime ansi.csi.EraseInLine(0), .{}); |
| 41 | } | 40 | } |