From 6a883e03cca4f5688b4dc88383793608e1ada857 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 26 Feb 2020 17:11:29 +0100 Subject: [PATCH] Fixes #91388: Add a cancel option --- src/vs/platform/undoRedo/common/undoRedoService.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/vs/platform/undoRedo/common/undoRedoService.ts b/src/vs/platform/undoRedo/common/undoRedoService.ts index 516dd459aee..8bcaf9d7d16 100644 --- a/src/vs/platform/undoRedo/common/undoRedoService.ts +++ b/src/vs/platform/undoRedo/common/undoRedoService.ts @@ -289,10 +289,17 @@ export class UndoRedoService implements IUndoRedoService { nls.localize('confirmWorkspace', "Would you like to undo '{0}' across all files?", element.label), [ nls.localize('ok', "Yes, change {0} files.", affectedEditStacks.length), - nls.localize('nok', "No, change only this file.") - ] + nls.localize('nok', "No, change only this file."), + nls.localize('cancel', "Cancel"), + ], + { + cancelId: 2 + } ).then((result) => { - if (result.choice === 0) { + if (result.choice === 2) { + // cancel + return; + } else if (result.choice === 0) { for (const editStack of affectedEditStacks) { editStack.past.pop(); editStack.future.push(element); -- GitLab