mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-27 21:09:31 +01:00
This commit is contained in:
@@ -373,10 +373,12 @@ export class InlineChatController implements IEditorContribution {
|
||||
this._messages.fire(msg);
|
||||
}));
|
||||
|
||||
const altVersionNow = this._editor.getModel()?.getAlternativeVersionId();
|
||||
|
||||
this._sessionStore.add(this._editor.onDidChangeModelContent(e => {
|
||||
|
||||
if (!this._ignoreModelContentChanged && this._strategy?.hasFocus()) {
|
||||
this._ctxUserDidEdit.set(true);
|
||||
this._ctxUserDidEdit.set(altVersionNow !== this._editor.getModel()?.getAlternativeVersionId());
|
||||
}
|
||||
|
||||
if (this._ignoreModelContentChanged || this._strategy?.hasFocus()) {
|
||||
@@ -467,7 +469,12 @@ export class InlineChatController implements IEditorContribution {
|
||||
const { lastExchange } = this._activeSession;
|
||||
this._activeSession.addInput(lastExchange.prompt.retry());
|
||||
if (lastExchange.response instanceof EditResponse) {
|
||||
await this._strategy.undoChanges(lastExchange.response);
|
||||
try {
|
||||
this._ignoreModelContentChanged = true;
|
||||
await this._strategy.undoChanges(lastExchange.response);
|
||||
} finally {
|
||||
this._ignoreModelContentChanged = false;
|
||||
}
|
||||
}
|
||||
return State.MAKE_REQUEST;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user