Skip to content

Conversation

@aiatsuk
Copy link

@aiatsuk aiatsuk commented Dec 13, 2025

Implement Neovide-style smooth cursor movement for editor and terminal. The cursor smoothly animates to new positions using inertial physics.

Controlled by smooth_caret setting (true/false).

Closes #4991

Release Notes:

  • Added smooth cursor animation for editor and terminal

@cla-bot
Copy link

cla-bot bot commented Dec 13, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @aiatsuk on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@aiatsuk
Copy link
Author

aiatsuk commented Dec 13, 2025

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 13, 2025
@cla-bot
Copy link

cla-bot bot commented Dec 13, 2025

The cla-bot has been summoned, and re-checked this pull request!

@aiatsuk aiatsuk force-pushed the smooth_cursor_animation branch 6 times, most recently from 417c0d0 to e642092 Compare December 13, 2025 19:47
Implement Neovide-style smooth cursor movement for editor and terminal.
The cursor smoothly animates to new positions using inertial physics.

Controlled by `smooth_caret` setting (true/false).

Closes zed-industries#4991
@aiatsuk aiatsuk force-pushed the smooth_cursor_animation branch from 95a0b5f to 3577c97 Compare December 13, 2025 21:32
@Dima-369
Copy link
Contributor

Thanks! I wondered:

With "smooth_caret": true (should definitely not be true by default) why is only crates/editor/src/inertial_cursor.rs used? There is also crates/editor/src/cursor_vfx.rs, but it can not be enabled in settings.json and the code does not use it directly?

So, it would be great if there would be Zed settings for smooth cursor configuration, basically for InertialCursorConfig. And since there is the VFX system already, how about user settings to actually use the VFX code and making CursorVfxConfig configurable in Zed settings?

Also, can you please provide screenshots/videos?

@MrSubidubi
Copy link
Member

Thanks for this! Aside from the test failures, I still think that #39095 (comment) very much applies here - you use window.request_animation_frame, which basically calls a notify for the entity underneath. This would mean that we constantly rerender the entirety of the editor for minimal work every frame, which would be quite expensive.

Otherwise, I'd very much agree with what was said above, so please also provide some context on that. Thanks!

@aiatsuk
Copy link
Author

aiatsuk commented Dec 15, 2025

With "smooth_caret": true (should definitely not be true by default) why is only crates/editor/src/inertial_cursor.rs used? There is also crates/editor/src/cursor_vfx.rs, but it can not be enabled in settings.json and the code does not use it directly?

You are absolutely right, I'll change that.

So, it would be great if there would be Zed settings for smooth cursor configuration, basically for InertialCursorConfig. And since there is the VFX system already, how about user settings to actually use the VFX code and making CursorVfxConfig configurable in Zed settings?

Currently, I'm simplifying the VFX system and remained for now only two options and added this to settings UI. I don't know if it's required to add the detailed configuration for the inertial cursor and for the VFX, so I propose to leave for now the toggle option and the select option for the effects.

Also, can you please provide screenshots/videos?

Sure, I'll add provide demo video

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.

Animated/smooth cursor movement

3 participants