File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/vs/workbench/contrib/inlineChat/browser Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -373,10 +373,12 @@ export class InlineChatController implements IEditorContribution {
373
373
this . _messages . fire ( msg ) ;
374
374
} ) ) ;
375
375
376
+ const altVersionNow = this . _editor . getModel ( ) ?. getAlternativeVersionId ( ) ;
377
+
376
378
this . _sessionStore . add ( this . _editor . onDidChangeModelContent ( e => {
377
379
378
380
if ( ! this . _ignoreModelContentChanged && this . _strategy ?. hasFocus ( ) ) {
379
- this . _ctxUserDidEdit . set ( true ) ;
381
+ this . _ctxUserDidEdit . set ( altVersionNow !== this . _editor . getModel ( ) ?. getAlternativeVersionId ( ) ) ;
380
382
}
381
383
382
384
if ( this . _ignoreModelContentChanged || this . _strategy ?. hasFocus ( ) ) {
@@ -467,7 +469,12 @@ export class InlineChatController implements IEditorContribution {
467
469
const { lastExchange } = this . _activeSession ;
468
470
this . _activeSession . addInput ( lastExchange . prompt . retry ( ) ) ;
469
471
if ( lastExchange . response instanceof EditResponse ) {
470
- await this . _strategy . undoChanges ( lastExchange . response ) ;
472
+ try {
473
+ this . _ignoreModelContentChanged = true ;
474
+ await this . _strategy . undoChanges ( lastExchange . response ) ;
475
+ } finally {
476
+ this . _ignoreModelContentChanged = false ;
477
+ }
471
478
}
472
479
return State . MAKE_REQUEST ;
473
480
}
You can’t perform that action at this time.
0 commit comments