Skip to content

Commit e6b16e8

Browse files
committed
Only validate if a workspace undo is selected
1 parent 4db079b commit e6b16e8

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,18 +440,17 @@ export class UndoRedoService implements IUndoRedoService {
440440
}
441441
);
442442

443-
// At this point, it is possible that the element has been made invalid in the meantime (due to the confirmation await)
444-
const verificationError = this._checkWorkspaceUndo(resource, element, affectedEditStacks);
445-
if (verificationError) {
446-
return verificationError.returnValue;
447-
}
448-
449443
if (result.choice === 2) {
450444
// cancel
451445
return;
452446
}
453447

454448
if (result.choice === 0) {
449+
// At this point, it is possible that the element has been made invalid in the meantime (due to the confirmation await)
450+
const verificationError = this._checkWorkspaceUndo(resource, element, affectedEditStacks);
451+
if (verificationError) {
452+
return verificationError.returnValue;
453+
}
455454
for (const editStack of affectedEditStacks) {
456455
editStack.past.pop();
457456
editStack.future.push(element);

0 commit comments

Comments
 (0)