this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

parser: fix parsing of DECRPM and tests

We were looking for the wrong sequence

+4 -4
+4 -4
src/Parser.zig
··· 539 539 }, 540 540 'y' => { 541 541 // DECRPM (CSI ? Ps ; Pm $ y) 542 - const delim_idx = std.mem.indexOfScalarPos(u8, input, 2, ';') orelse return null_event; 543 - const ps = std.fmt.parseUnsigned(u16, input[2..delim_idx], 10) catch return null_event; 544 - const pm = std.fmt.parseUnsigned(u8, input[delim_idx + 1 .. sequence.len - 1], 10) catch return null_event; 542 + const delim_idx = std.mem.indexOfScalarPos(u8, input, 3, ';') orelse return null_event; 543 + const ps = std.fmt.parseUnsigned(u16, input[3..delim_idx], 10) catch return null_event; 544 + const pm = std.fmt.parseUnsigned(u8, input[delim_idx + 1 .. sequence.len - 2], 10) catch return null_event; 545 545 switch (ps) { 546 546 // Mouse Pixel reporting 547 547 1016 => switch (pm) { ··· 974 974 test "parse(csi): decrpm" { 975 975 var buf: [1]u8 = undefined; 976 976 { 977 - const input = "\x1b[1016;1y"; 977 + const input = "\x1b[?1016;1$y"; 978 978 const result = parseCsi(input, &buf); 979 979 const expected: Result = .{ 980 980 .event = .cap_sgr_pixels,