Revert "Return the previous suggestion when replacing it"

This reverts commit 971c88db80.
This commit is contained in:
Antonio Scandurra 2023-04-04 18:59:21 +02:00
parent b58ac815a8
commit 65fd605b82
3 changed files with 11 additions and 23 deletions

View file

@ -2881,11 +2881,9 @@ impl Editor {
}
fn hide_copilot_suggestion(&mut self, cx: &mut ViewContext<Self>) -> bool {
let old_suggestion = self
.display_map
.update(cx, |map, cx| map.replace_suggestion::<usize>(None, cx));
if old_suggestion.is_some() {
if self.has_active_copilot_suggestion(cx) {
self.display_map
.update(cx, |map, cx| map.replace_suggestion::<usize>(None, cx));
cx.notify();
true
} else {