Skip to content

Commit dc43bc6

Browse files
committed
Fixes microsoft#91371: Do something (the local file) even when a cross file undo/redo cannt be applied
1 parent ebafcb9 commit dc43bc6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/platform/undoRedo/common/undoRedoService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export class UndoRedoService implements IUndoRedoService {
260260
this._splitPastWorkspaceElement(element, element.removedResources.set);
261261
const message = nls.localize('cannotWorkspaceUndo', "Could not undo '{0}' across all files. {1}", element.label, element.removedResources.createMessage());
262262
this._notificationService.info(message);
263-
return;
263+
return this.undo(resource);
264264
}
265265

266266
// this must be the last past element in all the impacted resources!
@@ -281,7 +281,7 @@ export class UndoRedoService implements IUndoRedoService {
281281
const paths = cannotUndoDueToResources.map(r => r.scheme === Schemas.file ? r.fsPath : r.path);
282282
const message = nls.localize('cannotWorkspaceUndoDueToChanges', "Could not undo '{0}' across all files because changes were made to {1}", element.label, paths.join(', '));
283283
this._notificationService.info(message);
284-
return;
284+
return this.undo(resource);
285285
}
286286

287287
return this._dialogService.show(
@@ -344,7 +344,7 @@ export class UndoRedoService implements IUndoRedoService {
344344
this._splitFutureWorkspaceElement(element, element.removedResources.set);
345345
const message = nls.localize('cannotWorkspaceRedo', "Could not redo '{0}' across all files. {1}", element.label, element.removedResources.createMessage());
346346
this._notificationService.info(message);
347-
return;
347+
return this.redo(resource);
348348
}
349349

350350
// this must be the last future element in all the impacted resources!
@@ -365,7 +365,7 @@ export class UndoRedoService implements IUndoRedoService {
365365
const paths = cannotRedoDueToResources.map(r => r.scheme === Schemas.file ? r.fsPath : r.path);
366366
const message = nls.localize('cannotWorkspaceRedoDueToChanges', "Could not redo '{0}' across all files because changes were made to {1}", element.label, paths.join(', '));
367367
this._notificationService.info(message);
368-
return;
368+
return this.redo(resource);
369369
}
370370

371371
for (const editStack of affectedEditStacks) {

0 commit comments

Comments
 (0)