Johannes
2023-09-27 15:56:12 +02:00
parent 1860ea1721
commit 1ad5fa669c
@@ -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;
}