parser: fix 0x0A decoding

0x0A should be decoded as Key.enter

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tim Culverhouse 2024-04-03 19:38:06 -05:00
parent 4118c5f8bc
commit 770f6d1c07

View file

@ -82,9 +82,11 @@ pub fn parse(self: *Parser, input: []const u8) !Result {
0x00 => .{ .codepoint = '@', .mods = .{ .ctrl = true } }, 0x00 => .{ .codepoint = '@', .mods = .{ .ctrl = true } },
0x08 => .{ .codepoint = Key.backspace }, 0x08 => .{ .codepoint = Key.backspace },
0x09 => .{ .codepoint = Key.tab }, 0x09 => .{ .codepoint = Key.tab },
0x0D => .{ .codepoint = Key.enter }, 0x0A,
0x0D,
=> .{ .codepoint = Key.enter },
0x01...0x07, 0x01...0x07,
0x0A...0x0C, 0x0B...0x0C,
0x0E...0x1A, 0x0E...0x1A,
=> .{ .codepoint = b + 0x60, .mods = .{ .ctrl = true } }, => .{ .codepoint = b + 0x60, .mods = .{ .ctrl = true } },
0x1B => escape: { 0x1B => escape: {