Skip to content

Commit 9d887e2

Browse files
author
Benjamin Pasero
committed
web - enable hot exit by default again
1 parent 4c7e299 commit 9d887e2

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/vs/platform/lifecycle/browser/lifecycleService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class BrowserLifecycleService extends AbstractLifecycleService {
2222
}
2323

2424
private registerListeners(): void {
25-
window.addEventListener('beforeunload', () => this.beforeUnload());
25+
window.onbeforeunload = () => this.beforeUnload();
2626
}
2727

2828
private beforeUnload(): string | null {

src/vs/workbench/contrib/files/browser/files.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ configurationRegistry.registerConfiguration({
311311
'type': 'string',
312312
'scope': ConfigurationScope.APPLICATION,
313313
'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE],
314-
'default': platform.isWeb ? HotExitConfiguration.OFF : HotExitConfiguration.ON_EXIT, // TODO@Ben enable once supported
314+
'default': HotExitConfiguration.ON_EXIT,
315315
'markdownEnumDescriptions': [
316316
nls.localize('hotExit.off', 'Disable hot exit.'),
317317
nls.localize('hotExit.onExit', 'Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu). All windows with backups will be restored upon next launch.'),

src/vs/workbench/services/backup/common/backupFileService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ class BackupFileServiceImpl implements IBackupFileService {
310310
return contents.substr(0, newLineIndex);
311311
}
312312

313-
throw new Error(`Could not find ${matchingString} in first ${maximumBytesToRead} bytes of ${file}`);
313+
throw new Error(`Could not find ${JSON.stringify(matchingString)} in first ${maximumBytesToRead} bytes of ${file}`);
314314
}
315315

316316
async resolveBackupContent<T extends object>(backup: URI): Promise<IResolvedBackup<T>> {

0 commit comments

Comments
 (0)