Assistant inline lose focus and make page to scroll up
Summary: Summoning inline assistant caused the editor to scroll up, when setting vertical_scroll_margin to a high value
If you add vertical_scroll_margin to the Zed settings (e.g., vertical_scroll_margin=60), and then scroll down a page and try to use the inline assistant, the page will automatically scroll up, causing the inline assistant input to not be visible and to lose focus.
Environment
Zed: v0.152.4 (Zed) OS: macOS 14.3.1 Memory: 16 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
https://github.com/user-attachments/assets/e3444d62-f064-47cf-a43d-5498ba4e89f6
If applicable, attach your Zed.log file to this issue.
Zed.log
Why do you have it set so high? It feels silly to set a vertical_scroll_margin to anything which is more than double your buffer height.
What is your expected behavior here? I guess when opening an inline assistant, Zed could clamp the effective vertical_scroll_margin to be 1/2 the number of lines which are currently visible in the buffer.
We'd happily review a PR to fix this, but given that it requires using an oversized value for vertical_scroll_margin to trigger this behavior it's unlikely to be something we prioritize.
Hi there! 👋 We're working to clean up our issue tracker by closing older bugs that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and it will be kept open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, it will close automatically in 14 days. Thanks for your help!
I’m able to reproduce this on zed@nightly on my macOS. I think Peter’s comment still applies: setting such a high value for vertical_scroll_margin seems like an outlier. The default is 3.
The only time you’d want such a high value is if you always want your scroll position to be at the top of your display.