Merge from vscode 2f984aad710215f4e4684a035bb02f55d1a9e2cc (#9819)

This commit is contained in:
Anthony Dresser
2020-04-01 00:44:39 -07:00
committed by GitHub
parent 0e27aaa61f
commit 0bfbdc62ed
247 changed files with 5402 additions and 3311 deletions

View File

@@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-window::before {
content: "\ea76"; /* Close icon flips between black dot and "X" for dirty windows */
}

View File

@@ -3,6 +3,8 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./media/actions';
import { URI } from 'vs/base/common/uri';
import { Action } from 'vs/base/common/actions';
import * as nls from 'vs/nls';
@@ -157,6 +159,12 @@ export abstract class BaseSwitchWindow extends Action {
tooltip: nls.localize('close', "Close Window")
};
private readonly closeDirtyWindowAction: IQuickInputButton = {
iconClass: 'dirty-window codicon-circle-filled',
tooltip: nls.localize('close', "Close Window"),
alwaysVisible: true
};
constructor(
id: string,
label: string,
@@ -185,7 +193,7 @@ export abstract class BaseSwitchWindow extends Action {
label: win.title,
iconClasses: getIconClasses(this.modelService, this.modeService, resource, fileKind),
description: (currentWindowId === win.id) ? nls.localize('current', "Current Window") : undefined,
buttons: (!this.isQuickNavigate() && currentWindowId !== win.id) ? [this.closeWindowAction] : undefined
buttons: currentWindowId !== win.id ? win.dirty ? [this.closeDirtyWindowAction] : [this.closeWindowAction] : undefined
};
});
const autoFocusIndex = (picks.indexOf(picks.filter(pick => pick.payload === currentWindowId)[0]) + 1) % picks.length;

View File

@@ -269,19 +269,17 @@ export class NativeWindow extends Disposable {
}));
}
// Document edited (macOS only): indicate for dirty working copies
if (isMacintosh) {
this._register(this.workingCopyService.onDidChangeDirty(workingCopy => {
const gotDirty = workingCopy.isDirty();
if (gotDirty && !(workingCopy.capabilities & WorkingCopyCapabilities.Untitled) && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) {
return; // do not indicate dirty of working copies that are auto saved after short delay
}
// Document edited: indicate for dirty working copies
this._register(this.workingCopyService.onDidChangeDirty(workingCopy => {
const gotDirty = workingCopy.isDirty();
if (gotDirty && !(workingCopy.capabilities & WorkingCopyCapabilities.Untitled) && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) {
return; // do not indicate dirty of working copies that are auto saved after short delay
}
this.updateDocumentEdited(gotDirty);
}));
this.updateDocumentEdited(gotDirty);
}));
this.updateDocumentEdited();
}
this.updateDocumentEdited();
// Detect minimize / maximize
this._register(Event.any(