edit prediction: Refine the stealth mode (#25599)

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
This commit is contained in:
Danilo Leal 2025-02-26 12:50:11 -03:00 committed by GitHub
parent c0b6d86c41
commit bab65011b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 119 additions and 64 deletions

View file

@ -3,7 +3,6 @@ pub(crate) mod autoscroll;
pub(crate) mod scroll_amount;
use crate::editor_settings::{ScrollBeyondLastLine, ScrollbarAxes};
use crate::EditPredictionPreview;
use crate::{
display_map::{DisplaySnapshot, ToDisplayPoint},
hover_popover::hide_hover,
@ -496,14 +495,8 @@ impl Editor {
hide_hover(self, cx);
let workspace_id = self.workspace.as_ref().and_then(|workspace| workspace.1);
if let EditPredictionPreview::Active {
previous_scroll_position,
} = &mut self.edit_prediction_preview
{
if !autoscroll {
previous_scroll_position.take();
}
}
self.edit_prediction_preview
.set_previous_scroll_position(None);
self.scroll_manager.set_scroll_position(
scroll_position,