Improve vim interactions with edit predictions (#24418)

* When an edit prediction is present in non-insertion modes, hide it but
show `tab Jump to edit`.
* Removes discarding of edit predictions when going from insert mode to
normal mode, instead just hide them in non-insertion modes.
* Removes zeta-specific showing of predictions in normal mode. This
behavior was only happening in special cases anyway - where the discard
of completions wasn't happening due to some other thing taking
precedence in `dismiss_menus_and_popups`.

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Michael Sloan 2025-02-07 03:53:38 -07:00 committed by GitHub
parent 92c21a2814
commit f700268029
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 102 additions and 88 deletions

View file

@ -42,7 +42,6 @@ pub trait InlineCompletionProvider: 'static + Sized {
fn name() -> &'static str;
fn display_name() -> &'static str;
fn show_completions_in_menu() -> bool;
fn show_completions_in_normal_mode() -> bool;
fn show_tab_accept_marker() -> bool {
false
}
@ -95,7 +94,6 @@ pub trait InlineCompletionProviderHandle {
cx: &App,
) -> bool;
fn show_completions_in_menu(&self) -> bool;
fn show_completions_in_normal_mode(&self) -> bool;
fn show_tab_accept_marker(&self) -> bool;
fn data_collection_state(&self, cx: &App) -> DataCollectionState;
fn toggle_data_collection(&self, cx: &mut App);
@ -142,10 +140,6 @@ where
T::show_completions_in_menu()
}
fn show_completions_in_normal_mode(&self) -> bool {
T::show_completions_in_normal_mode()
}
fn show_tab_accept_marker(&self) -> bool {
T::show_tab_accept_marker()
}