| ... | @@ -52,7 +52,7 @@ pub const escape = struct { | ... | @@ -52,7 +52,7 @@ pub const escape = struct { |
| 52 | pub const RIS = ascii.ESC.s() ++ "c"; | 52 | pub const RIS = ascii.ESC.s() ++ "c"; |
| 53 | }; | 53 | }; |
| 54 | | 54 | |
| 55 | fn make_csi_sequence(comptime c: []const u8, x: anytype) []const u8 { | 55 | fn make_csi_sequence(comptime c: []const u8, comptime x: anytype) []const u8 { |
| 56 | return escape.CSI ++ _join(";", arr_i_to_s(x)) ++ c; | 56 | return escape.CSI ++ _join(";", arr_i_to_s(x)) ++ c; |
| 57 | } | 57 | } |
| 58 | | 58 | |
| ... | @@ -65,20 +65,20 @@ fn arr_i_to_s(x: anytype) [][]const u8 { | ... | @@ -65,20 +65,20 @@ fn arr_i_to_s(x: anytype) [][]const u8 { |
| 65 | } | 65 | } |
| 66 | | 66 | |
| 67 | pub const csi = struct { | 67 | pub const csi = struct { |
| 68 | pub fn CursorUp(n: i32) []const u8 { return make_csi_sequence("A", .{n}); } | 68 | pub fn CursorUp(comptime n: i32) []const u8 { return make_csi_sequence("A", .{n}); } |
| 69 | pub fn CursorDown(n: i32) []const u8 { return make_csi_sequence("B", .{n}); } | 69 | pub fn CursorDown(comptime n: i32) []const u8 { return make_csi_sequence("B", .{n}); } |
| 70 | pub fn CursorForward(n: i32) []const u8 { return make_csi_sequence("C", .{n}); } | 70 | pub fn CursorForward(comptime n: i32) []const u8 { return make_csi_sequence("C", .{n}); } |
| 71 | pub fn CursorBack(n: i32) []const u8 { return make_csi_sequence("D", .{n}); } | 71 | pub fn CursorBack(comptime n: i32) []const u8 { return make_csi_sequence("D", .{n}); } |
| 72 | pub fn CursorNextLine(n: i32) []const u8 { return make_csi_sequence("E", .{n}); } | 72 | pub fn CursorNextLine(comptime n: i32) []const u8 { return make_csi_sequence("E", .{n}); } |
| 73 | pub fn CursorPrevLine(n: i32) []const u8 { return make_csi_sequence("F", .{n}); } | 73 | pub fn CursorPrevLine(comptime n: i32) []const u8 { return make_csi_sequence("F", .{n}); } |
| 74 | pub fn CursorHorzAbs(n: i32) []const u8 { return make_csi_sequence("G", .{n}); } | 74 | pub fn CursorHorzAbs(comptime n: i32) []const u8 { return make_csi_sequence("G", .{n}); } |
| 75 | pub fn CursorPos(n: i32, m: i32) []const u8 { return make_csi_sequence("H", .{n, m}); } | 75 | pub fn CursorPos(comptime n: i32, m: i32) []const u8 { return make_csi_sequence("H", .{n, m}); } |
| 76 | pub fn EraseInDisplay(n: i32) []const u8 { return make_csi_sequence("J", .{n}); } | 76 | pub fn EraseInDisplay(comptime n: i32) []const u8 { return make_csi_sequence("J", .{n}); } |
| 77 | pub fn EraseInLine(n: i32) []const u8 { return make_csi_sequence("K", .{n}); } | 77 | pub fn EraseInLine(comptime n: i32) []const u8 { return make_csi_sequence("K", .{n}); } |
| 78 | pub fn ScrollUp(n: i32) []const u8 { return make_csi_sequence("S", .{n}); } | 78 | pub fn ScrollUp(comptime n: i32) []const u8 { return make_csi_sequence("S", .{n}); } |
| 79 | pub fn ScrollDown(n: i32) []const u8 { return make_csi_sequence("T", .{n}); } | 79 | pub fn ScrollDown(comptime n: i32) []const u8 { return make_csi_sequence("T", .{n}); } |
| 80 | pub fn HorzVertPos(n: i32, m: i32) []const u8 { return make_csi_sequence("f", .{n, m}); } | 80 | pub fn HorzVertPos(comptime n: i32, m: i32) []const u8 { return make_csi_sequence("f", .{n, m}); } |
| 81 | pub fn SGR(ns: anytype) []const u8 { return make_csi_sequence("m", ns); } | 81 | pub fn SGR(comptime ns: anytype) []const u8 { return make_csi_sequence("m", ns); } |
| 82 | }; | 82 | }; |
| 83 | | 83 | |
| 84 | pub const style = struct { | 84 | pub const style = struct { |