-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Unconventional C-a,C-e shortcut key behavior on word wrap #25372
Comments
Unfortunately, it's not very clear from the macOS keymap json, but that action has a way to be configured: zed/assets/keymaps/linux/emacs.json Lines 27 to 28 in 10a6cd0
to jump to the end of the real line. |
Closes #25372 Release Notes: - N/A
Thank you for pointing me in the right direction. Would you accept a pull request to change those booleans to a more standardized default behavior to conform with other Mac apps? Not sure if the Zed project values the Principal of Least Surprise, but this, in my view, is a clear case where the non-standard use should be the configuration change, not the other way around. |
We seem to use different macOS apps it seems: I have just rechecked Sublime Text, VSCode and RustRover and neither of them jump to the end of the wrapped line when So, to me this works exactly as it should be. |
Respectfully, can you check again. CMD-left and CMD-right are working correctly in Zed - namely stopping at the soft wrap. It's C-a and C-e that behave differently. I verified in VSCode, Pages, Notes, Safari, SublimeText, and multiple others before submitting this issue. |
Oh, sorry, the emacs bindings, now I finally understand. |
Happy to merge the PR after #25385 (comment) |
I believe @nathansobo wants to maintain the default behavior of zed/assets/keymaps/default-macos.json Line 95 in 1e12285
PR: See previously: |
Is it fair to say that personal preference and legacy Atom behavior aren't convincing reasons to deviate from the default expected behavior of other Mac apps? Are there other good reasons to use a non-standard behavior for C-a I'm not considering? The common use case where I discovered the issue was multi-cursor editing multiple lines. Since Macs don't have a dedicated home button, ⌘-left and C-a having distinct and predictable behaviors is a big plus. EDIT: Oh, I think I see now. There's a desire for C-a to stop at the first indent instead of going to the true start of a line? Regardless, I think the point can still be made that the C-a behavior seen in Apple apps (eg: XCode, Notes, Pages) and non-Apple Mac apps (Sublime, Emacs, VSCode) is the better default and configuring different behavior from that should be possible, but not the standard. |
I believe that the previous behavior of I absolutely understand your position, but when looking into this issue I noticed it is not as cut and dry as I had assumed. Notably there are significant divergences in behaviors so necessarily there must be design choices as to which behavior(s) Zed decides to adopt/emulate. Some apps have the same behavior for all three inputs (e.g. home/ctrl-a/cmd-left behave identically) and many have divergent behaviors. Notably macOS and VSCode have the same behavior for
To be clear the decision point is whether in Zed, in the default keymap, Thanks for your PR to improve the default keymap, I had identical changes in my user keymap and then later adopted the emacs keymap so haven't experienced that friction in a long time. |
Summary
CTRL-A and CTRL-E don't behave properly in Zed on a Mac.
Steps to trigger the problem:
Actual Behavior:
C-a and C-e improperly behave like ⌘-LEFT and ⌘-RIGHT respectively. They go to the beginning/end of the soft wrap line, not the true line.
Expected Behavior:
Every Mac app (Notes, Pages, Safari, etc) makes C-a go to the true beginning of the line and C-e to the true end, not the soft wrap boundaries. ⌘-LEFT and ⌘-RIGHT are the shortcuts for softwrap begin/end. Zed should not by default be doing this differently.
Zed Version and System Specs
Zed: v0.173.8 (Zed)
OS: macOS 15.3.1
Memory: 64 GiB
Architecture: aarch64
The text was updated successfully, but these errors were encountered: