Skip to content

Commit b7f71bd

Browse files
authored
Closing dialog does not cancel (Manjaro Linux) (fix microsoft#154719) (microsoft#155049)
* Closing dialog does not cancel (Manjaro Linux) (fix microsoft#154719) * set `cancelId`
1 parent c9c6219 commit b7f71bd

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/vs/platform/dialogs/common/dialogs.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,11 @@ export interface IDialogService {
273273
/**
274274
* Present a modal dialog to the user.
275275
*
276+
* @param severity the severity of the message
277+
* @param message the message to show
278+
* @param buttons the buttons to show. By convention, the first button should be the
279+
* primary action and the last button the "Cancel" action.
280+
*
276281
* @returns A promise with the selected choice index. If the user refused to choose,
277282
* then a promise with index of `cancelId` option is returned. If there is no such
278283
* option then promise with index `0` is returned.

src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,14 @@ class BulkEditPreviewContribution {
122122
const choice = await this._dialogService.show(
123123
Severity.Info,
124124
localize('overlap', "Another refactoring is being previewed."),
125-
[localize('cancel', "Cancel"), localize('continue', "Continue")],
126-
{ detail: localize('detail', "Press 'Continue' to discard the previous refactoring and continue with the current refactoring.") }
125+
[localize('continue', "Continue"), localize('cancel', "Cancel")],
126+
{
127+
detail: localize('detail', "Press 'Continue' to discard the previous refactoring and continue with the current refactoring."),
128+
cancelId: 1
129+
}
127130
);
128131

129-
if (choice.choice === 0) {
132+
if (choice.choice === 1) {
130133
// this refactoring is being cancelled
131134
return [];
132135
}

src/vs/workbench/contrib/format/browser/formatActionsNone.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ registerEditorAction(class FormatDocumentMultipleAction extends EditorAction {
6868
const res = await dialogService.show(
6969
Severity.Info,
7070
message,
71-
[nls.localize('cancel', "Cancel"), nls.localize('install.formatter', "Install Formatter...")]
71+
[nls.localize('install.formatter', "Install Formatter..."), nls.localize('cancel', "Cancel")],
72+
{ cancelId: 1 }
7273
);
73-
if (res.choice === 1) {
74+
if (res.choice !== 1) {
7475
showExtensionQuery(paneCompositeService, `category:formatters ${langName}`);
7576
}
7677
}

0 commit comments

Comments
 (0)