Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: Improve deadkeys #20515

Merged
merged 8 commits into from
Nov 11, 2024
Merged

macOS: Improve deadkeys #20515

merged 8 commits into from
Nov 11, 2024

Conversation

ConradIrwin
Copy link
Member

@ConradIrwin ConradIrwin commented Nov 11, 2024

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.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 11, 2024
@zed-industries-bot
Copy link

zed-industries-bot commented Nov 11, 2024

Warnings
⚠️
macOS: Improve deadkeys
^

Write PR titles using sentence case.

Have feedback on this plugin? Let's hear it!

Generated by 🚫 dangerJS against edafab6

@ConradIrwin ConradIrwin merged commit 2ea4ede into main Nov 11, 2024
11 checks passed
@ConradIrwin ConradIrwin deleted the fix-deadkeys branch November 11, 2024 23:34
maxbrunsfeld added a commit that referenced this pull request Nov 13, 2024
maxbrunsfeld added a commit that referenced this pull request Nov 13, 2024
This reverts commit #20515

I'm reverting for now to fix issues with key bindings on Nightly:
* `ctrl-c` and `ctrl-m` are being treated as `ctrl-enter`
* `ctrl-[` isn't working in vim mode
* there's a delay before `cmd-shift-[` switches tabs w/ vim mode enabled

Release Notes:

- N/A
ConradIrwin added a commit that referenced this pull request Nov 13, 2024
@ConradIrwin ConradIrwin mentioned this pull request Nov 13, 2024
ConradIrwin added a commit that referenced this pull request Nov 13, 2024
Re-land of #20515 with less brokenness

In particular it turns out that for control, the .characters() method
returns the control code. This mostly didn't make a difference, except
when the control code matched tab/enter/escape (for
ctrl-y,ctrl-[/ctrl-c) as we interpreted the key incorrectly.

Secondly, we were setting IME key too aggressively. This led to (in vim
mode) cmd-shift-{ being interpreted as [, so vim would wait for a second
[ before letting you change tab.

Release Notes:

- N/A
notpeter pushed a commit that referenced this pull request Nov 13, 2024
Re-land of #20515 with less brokenness

In particular it turns out that for control, the .characters() method
returns the control code. This mostly didn't make a difference, except
when the control code matched tab/enter/escape (for
ctrl-y,ctrl-[/ctrl-c) as we interpreted the key incorrectly.

Secondly, we were setting IME key too aggressively. This led to (in vim
mode) cmd-shift-{ being interpreted as [, so vim would wait for a second
[ before letting you change tab.

Release Notes:

- N/A
mrnugget added a commit that referenced this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vim: QWERTZ keyboard breaks ^ to move to begin of the line
2 participants