zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.89k stars 2.81k forks source link

Navigating with command + key behaves differently with backspace than arrow keys #4311

Open magnuspaaske opened 9 months ago

magnuspaaske commented 9 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

When a line is wrapped in the editor to be shown across multiple lines navigating with command pressed behaves differently depending if arrow keys are used or backspace.

When pressing command + left arrow the cursor moves to the left most position in the wrapped line as expected. With command + shift + left arrow it highlights the wrapped line as it's displayed on the screen.

However using command + backspace ignores the wrapping and deletes the entire line up to the line break in the file. This is pretty unintuitive and seems like a bug.

Environment

Zed: v0.115.3 (stable) OS: macOS 14.1.2 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

The issue was tested with a markdown file where the file level lines are wrapped and shown on multiple lines. One example could be the below line

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan non quam ut 
vestibulum. Nunc eget eleifend mauris, eget ultrices risus**<cursor here>**

If pressing command + left arrow the cursor will be right before the v in vestibulum, but if pressing command + backspace the entire line is deleted.

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

JosephTLyons commented 9 months ago

Hey @magnuspaaske - totally get the inconsistency here, but I just wanted to ask, if you were to fix this, would you change the behavior of cmd-delete to match the behavior of say cmd-shift-left, or vice versa?

magnuspaaske commented 9 months ago

@JosephTLyons I would change the behaviour of cmd-delete to match that of cmd-shift-left. Might want to hide it behind a setting (or not depending how customizable things should be). FWIW I also checked it on Sublime Text and found the same behaviour

github-actions[bot] commented 1 week ago

Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. Are you able to reproduce this issue in the latest version of Zed? If so, please let us know by commenting on this issue and we will keep it open; otherwise, we'll close it in a week. Feel free to open a new issue if you're seeing this message after the issue has been closed. Thanks for your help!