Skip to content

Commit

Permalink
Revert "vim: Don't dismiss inline completion when switching to normal…
Browse files Browse the repository at this point in the history
… mode (#22075)" (#22131)

This reverts commit 38c0aa3 from
#22075.

Release Notes:

- N/A
  • Loading branch information
mrnugget authored Dec 17, 2024
1 parent ebf6804 commit 9082a00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2427,7 +2427,7 @@ impl Editor {
cx.notify();
return;
}
if self.dismiss_menus_and_popups(false, true, cx) {
if self.dismiss_menus_and_popups(true, cx) {
return;
}

Expand All @@ -2442,7 +2442,6 @@ impl Editor {

pub fn dismiss_menus_and_popups(
&mut self,
keep_inline_completion: bool,
should_report_inline_completion_event: bool,
cx: &mut ViewContext<Self>,
) -> bool {
Expand All @@ -2466,9 +2465,7 @@ impl Editor {
return true;
}

if !keep_inline_completion
&& self.discard_inline_completion(should_report_inline_completion_event, cx)
{
if self.discard_inline_completion(should_report_inline_completion_event, cx) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion crates/vim/src/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Vim {
if count <= 1 || Vim::globals(cx).dot_replaying {
self.create_mark("^".into(), false, cx);
self.update_editor(cx, |_, editor, cx| {
editor.dismiss_menus_and_popups(true, false, cx);
editor.dismiss_menus_and_popups(false, cx);
editor.change_selections(Some(Autoscroll::fit()), cx, |s| {
s.move_cursors_with(|map, mut cursor, _| {
*cursor.column_mut() = cursor.column().saturating_sub(1);
Expand Down

0 comments on commit 9082a00

Please sign in to comment.