input: fix bs emitting sequence when it should not

In korean input method on macos, it should simply return empty string.
Issue was created after https://github.com/mitchellh/ghostty/pull/1659.

```
gksr<BS> # 한ㄱ<BS>
```

'ㄱ' at the end should be removed with single <BS>, but for now
it requires two <bs> to remove 'ㄱ'.
This commit is contained in:
rok
2024-04-08 22:11:01 +09:00
parent 35c4059f18
commit df9b8f1fbc

View File

@ -266,10 +266,8 @@ fn legacy(
if (self.event.utf8.len > 0) { if (self.event.utf8.len > 0) {
switch (self.event.key) { switch (self.event.key) {
else => {}, else => {},
.enter, .backspace => return "",
.escape, .enter, .escape => break :pc_style,
.backspace,
=> break :pc_style,
} }
} }
@ -1658,7 +1656,7 @@ test "legacy: backspace with utf8 (dead key state)" {
}; };
const actual = try enc.legacy(&buf); const actual = try enc.legacy(&buf);
try testing.expectEqualStrings("A", actual); try testing.expectEqualStrings("", actual);
} }
test "legacy: enter with utf8 (dead key state)" { test "legacy: enter with utf8 (dead key state)" {