mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 19:10:24 +00:00
📝
This commit is contained in:
parent
52e1e014ad
commit
ccec59337a
1 changed files with 5 additions and 2 deletions
|
@ -341,6 +341,9 @@ impl AssistantPanel {
|
|||
this.pending_inline_assists.get(&inline_assist_id)
|
||||
{
|
||||
if pending_assist.transaction_id == Some(*tx_id) {
|
||||
// Notice we are supplying `undo: false` here. This
|
||||
// is because there's no need to undo the transaction
|
||||
// because the user just did so.
|
||||
this.close_inline_assist(
|
||||
inline_assist_id,
|
||||
false,
|
||||
|
@ -421,7 +424,7 @@ impl AssistantPanel {
|
|||
}
|
||||
}
|
||||
|
||||
fn close_inline_assist(&mut self, assist_id: usize, cancel: bool, cx: &mut ViewContext<Self>) {
|
||||
fn close_inline_assist(&mut self, assist_id: usize, undo: bool, cx: &mut ViewContext<Self>) {
|
||||
self.hide_inline_assist(assist_id, cx);
|
||||
|
||||
if let Some(pending_assist) = self.pending_inline_assists.remove(&assist_id) {
|
||||
|
@ -438,7 +441,7 @@ impl AssistantPanel {
|
|||
if let Some(editor) = pending_assist.editor.upgrade(cx) {
|
||||
self.update_highlights_for_editor(&editor, cx);
|
||||
|
||||
if cancel {
|
||||
if undo {
|
||||
if let Some(transaction_id) = pending_assist.transaction_id {
|
||||
editor.update(cx, |editor, cx| {
|
||||
editor.buffer().update(cx, |buffer, cx| {
|
||||
|
|
Loading…
Reference in a new issue