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
45.71k stars 2.52k forks source link

In Vim mode, `ctrl-u` doesn't consistently scroll to the top #13250

Closed 0ax1 closed 1 month ago

0ax1 commented 2 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

When using Zed in Vim mode, it is not possible to scroll the cursor to the first line with ctrl-u.

2 different behaviors that can be observed:

After mentioning this on the Zed Discord, @ConradIrwin's assumption was that this issue is due to using vertical_scroll_margin in places where a diff API would be more suitable.

Environment

Zed: v0.139.3 (Zed) OS: macOS 14.5.0 Memory: 24 GiB Architecture: aarch64

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

In the attached video, I'm keeping ctrl-u pressed but it stops scrolling at line 31. This corresponds to the line which was previously clicked with the mouse cursor.

https://github.com/zed-industries/zed/assets/1750040/ba26a0d4-6ecf-4d7e-9085-93908e71a725

osa1 commented 1 month ago

ctrl-d is also not working as expected. I think the implementation of ctrl-u and d should be: move cursor N lines up/down rather than scroll up/down.

I wanted to fix this in my key bindings but I can't find how to say "repeat Vim::Down/Up 9 times".

JosephTLyons commented 1 month ago

This is now in today's preview release.