input: escape can be used to clear dead key state

This fixes korean input method issue on mac. When typing korean
and press escape in vim, composing korean character should remain.
This commit is contained in:
rok
2024-04-05 03:06:50 +09:00
parent 5440fda3fb
commit 9326ae363c

View File

@ -254,10 +254,10 @@ fn legacy(
self.ignore_keypad_with_numlock, self.ignore_keypad_with_numlock,
self.modify_other_keys_state_2, self.modify_other_keys_state_2,
)) |sequence| pc_style: { )) |sequence| pc_style: {
// If we're pressing enter and have UTF-8 text, we probably are // If we're pressing enter or escape and have UTF-8 text, we probably are
// clearing a dead key state. This happens specifically on macOS. // clearing a dead key state. This happens specifically on macOS.
// We have a unit test for this. // We have a unit test for this.
if (self.event.key == .enter and self.event.utf8.len > 0) { if (self.event.key == .enter or self.event.key == .escape and self.event.utf8.len > 0) {
break :pc_style; break :pc_style;
} }