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,20 +5457,28 @@ impl Editor {
|
||||||
};
|
};
|
||||||
|
|
||||||
if &accept_keystroke.modifiers == modifiers {
|
if &accept_keystroke.modifiers == modifiers {
|
||||||
if let Some(completion) = self.active_inline_completion.as_ref() {
|
let Some(completion) = self.active_inline_completion.as_ref() else {
|
||||||
if self.edit_prediction_preview.start(
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
if !self.edit_prediction_requires_modifier() && !self.has_visible_completions_menu() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let transitioned = self.edit_prediction_preview.start(
|
||||||
&completion.completion,
|
&completion.completion,
|
||||||
&position_map.snapshot,
|
&position_map.snapshot,
|
||||||
self.selections
|
self.selections
|
||||||
.newest_anchor()
|
.newest_anchor()
|
||||||
.head()
|
.head()
|
||||||
.to_display_point(&position_map.snapshot),
|
.to_display_point(&position_map.snapshot),
|
||||||
) {
|
);
|
||||||
|
|
||||||
|
if transitioned {
|
||||||
self.request_autoscroll(Autoscroll::fit(), cx);
|
self.request_autoscroll(Autoscroll::fit(), cx);
|
||||||
self.update_visible_inline_completion(window, cx);
|
self.update_visible_inline_completion(window, cx);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if self.edit_prediction_preview.end(
|
} else if self.edit_prediction_preview.end(
|
||||||
self.selections
|
self.selections
|
||||||
.newest_anchor()
|
.newest_anchor()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue