edit predictions: Don't animate cursor when jumping in eager mode without LSP completions (#24664)
We should only do this in "holding modifier" mode OR when there's a language server completions menu. Release Notes: - N/A
This commit is contained in:
parent
b395beaf93
commit
14d9788ba3
1 changed files with 21 additions and 13 deletions
|
@ -5457,19 +5457,27 @@ impl Editor {
|
|||
};
|
||||
|
||||
if &accept_keystroke.modifiers == modifiers {
|
||||
if let Some(completion) = self.active_inline_completion.as_ref() {
|
||||
if self.edit_prediction_preview.start(
|
||||
&completion.completion,
|
||||
&position_map.snapshot,
|
||||
self.selections
|
||||
.newest_anchor()
|
||||
.head()
|
||||
.to_display_point(&position_map.snapshot),
|
||||
) {
|
||||
self.request_autoscroll(Autoscroll::fit(), cx);
|
||||
self.update_visible_inline_completion(window, cx);
|
||||
cx.notify();
|
||||
}
|
||||
let Some(completion) = self.active_inline_completion.as_ref() else {
|
||||
return;
|
||||
};
|
||||
|
||||
if !self.edit_prediction_requires_modifier() && !self.has_visible_completions_menu() {
|
||||
return;
|
||||
}
|
||||
|
||||
let transitioned = self.edit_prediction_preview.start(
|
||||
&completion.completion,
|
||||
&position_map.snapshot,
|
||||
self.selections
|
||||
.newest_anchor()
|
||||
.head()
|
||||
.to_display_point(&position_map.snapshot),
|
||||
);
|
||||
|
||||
if transitioned {
|
||||
self.request_autoscroll(Autoscroll::fit(), cx);
|
||||
self.update_visible_inline_completion(window, cx);
|
||||
cx.notify();
|
||||
}
|
||||
} else if self.edit_prediction_preview.end(
|
||||
self.selections
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue