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
48.41k stars 2.88k forks source link

Incorrect control-A and control-E behavior with soft_wrap #4554

Open sethherr opened 1 year ago

sethherr commented 1 year ago

Check for existing issues

Describe the bug / provide steps to reproduce it

When editing a file that with soft wrapping:

These should go to the beginning and end of the line, not the soft wrapped character limit.

control-k behaves correctly, and deletes to the end of the line, rather than the soft-wrap line.

Environment

Zed: v0.97.5 (stable) OS: macOS 13.4.1 Memory: 32 GiB Architecture: aarch64

failable commented 1 year ago

I think that's desired behavior. If you want to go to the 'real' beginning/end of line, just ctrl a / ctrl e again.

sethherr commented 1 year ago

Oh, I didn't know about double pressing to go to the real beginning of the line. That's great @liebkne!

It seems a little surprising though, do other apps have that behavior?

Would it make sense to make ctrl + k do the same thing?

notpeter commented 3 months ago

I don't like Zed's handling of ctrl-e and ctrl-a with soft-wrap enabled. It is surprising that behavior changes depending on the width of my editor pane: "ctrl-e goes to the end of the line, unless your window is narrow and then you have to press ctrl-e twice".

So I took a survey:

Editors that ignore soft wrap when jumping to the beginning/end with ctrl-a/ctrl-e

Same as Zed (double tap when navigating thru a word wrap):