未验证 提交 6a883e03 编写于 作者: A Alex Dima

Fixes #91388: Add a cancel option

上级 b59e3a6f
...@@ -289,10 +289,17 @@ export class UndoRedoService implements IUndoRedoService { ...@@ -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('confirmWorkspace', "Would you like to undo '{0}' across all files?", element.label),
[ [
nls.localize('ok', "Yes, change {0} files.", affectedEditStacks.length), 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) => { ).then((result) => {
if (result.choice === 0) { if (result.choice === 2) {
// cancel
return;
} else if (result.choice === 0) {
for (const editStack of affectedEditStacks) { for (const editStack of affectedEditStacks) {
editStack.past.pop(); editStack.past.pop();
editStack.future.push(element); editStack.future.push(element);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册