diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 073f7dc441ff44e97f689bb61a70b2a8fb74100b..8ecf84999102342b1d4d802ab7c40d0245aa111e 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -1326,7 +1326,17 @@ export class WindowsManager implements IWindowsMainService { } // Handle untitled workspaces with prompt as needed - e.veto(this.workspacesManager.promptToSaveUntitledWorkspace(this.getWindowById(e.window.id), workspace)); + e.veto(this.workspacesManager.promptToSaveUntitledWorkspace(this.getWindowById(e.window.id), workspace).then(veto => { + if (veto) { + return veto; + } + + // Bug in electron: somehow we need this timeout so that the window closes properly. That + // might be related to the fact that the untitled workspace prompt shows up async and this + // code can execute before the dialog is fully closed which then blocks the window from closing. + // Issue: https://github.com/Microsoft/vscode/issues/41989 + return TPromise.timeout(0).then(() => veto); + })); } public focusLastActive(cli: ParsedArgs, context: OpenContext): CodeWindow { diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 27c58c24d2e628f9421da9067aeb372d6a093a2e..5a05edb5ccc1fac4c6f8e89b37fe0af3e170b814 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -38,7 +38,7 @@ import { PieceTreeTextBufferBuilder } from 'vs/editor/common/model/pieceTreeText import { ChunksTextBufferBuilder } from 'vs/editor/common/model/chunksTextBuffer/chunksTextBufferBuilder'; // Here is the master switch for the text buffer implementation: -const USE_PIECE_TREE_IMPLEMENTATION = false; +const USE_PIECE_TREE_IMPLEMENTATION = true; const USE_CHUNKS_TEXT_BUFFER = false; function createTextBufferBuilder() {