Rework edit prediction preview mode (#24700)
Don't animate the cursor when previewing jumps. Instead, display the jump popover with a line that resembles a cursor, indicating the jump destination. If the jump destination is outside of the view port, there is an extra step in which `tab` scrolls the viewport to reveal the jump destination. Release Notes: - N/A --------- Co-authored-by: danilo-leal <daniloleal09@gmail.com> Co-authored-by: agu-z <hi@aguz.me>
This commit is contained in:
parent
5293f5724c
commit
148547ecd1
5 changed files with 245 additions and 519 deletions
|
@ -3,6 +3,7 @@ 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,
|
||||
|
@ -495,6 +496,15 @@ 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.scroll_manager.set_scroll_position(
|
||||
scroll_position,
|
||||
&display_map,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue