macOS: Improve deadkeys (#20515)

Closes #19738

This change refactors how we handle input on macOS to avoid simulating
our own IME. This fixes a number of small edge-cases, and also lets us
remove a bunch of code that had been added to work around bugs in the
previous version.

Release Notes:

- On macOS: Keyboard shortcuts are now handled before activating the IME
system, this enables using vim's default mode on keyboards that use IME
menus (like Japanese).
- On macOS: Improvements to handling of dead-keys. For example when
typing `""` on a Brazillian keyboard, you now get a committed " and a
new marked ", as happens in other apps. Also, you can now type cmd-^ on
an AZERTY keyboard for indent; and ^ on a QWERTZ keyboard now goes to
the beginning of line in vim normal mode, or `d i "` no requires no
space to delete within quotes on Brazilian keyboards (though `d f "
space` is still required as `f` relies on the input handler, not a
binding).
- On macOS: In the terminal pane, holding down a key will now repeat
that key (as happens in iTerm2) instead of opening the character
selector.
This commit is contained in:
Conrad Irwin 2024-11-11 16:34:36 -07:00 committed by GitHub
parent 38f2a919f8
commit 2ea4ede08e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 228 additions and 218 deletions

View file

@ -1044,6 +1044,10 @@ impl InputHandler for TerminalInputHandler {
) -> Option<Bounds<Pixels>> {
self.cursor_bounds
}
fn apple_press_and_hold_enabled(&mut self) -> bool {
false
}
}
pub fn is_blank(cell: &IndexedCell) -> bool {