From fe28eed3d0a21cfaca31e0a9ee3e5b47e9bc6cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=81=93=E5=8C=96=E5=B8=AB?= Date: Sun, 19 Mar 2017 19:41:17 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=8B=20=E8=A8=AD=E5=AE=9A=E3=82=B3?= =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=83=89=E3=81=A7=E8=A8=AD=E5=AE=9A=E3=81=97?= =?UTF-8?q?=E3=81=9F=E5=86=85=E5=AE=B9=E3=81=8C=E6=8F=AE=E7=99=BA=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E5=95=8F=E9=A1=8C=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/extension.ts | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 18ea905..fb737dc 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1599,39 +1599,23 @@ module WandboxVSCode ) ); - /* - workbench.action.files.newUntitledFile を呼び出した際になぜか閉じられてもなければ untiled でもないドキュメント - が untiled な扱いで閉じたとされて呼び出されてしまう。 vscode v1.9.1 のバグではないかと思われる。仕方が無いので - vscode.window.onDidChangeActiveTextEditor 内で代わりに処理するように修正した。 vscode.workspace.onDidCloseTextDocument ( (document : vscode.TextDocument) => { - if (document.isUntitled && fileSetting[document.fileName]) + if + ( + // ここで見つかる場合は本当には閉じられてない + !vscode.workspace.textDocuments + .find(i => i.fileName === document.fileName) && + fileSetting[document.fileName] + ) { + OutputChannel.appendLine(`delete fileSetting[${document.fileName}]`); delete fileSetting[document.fileName]; } } ); - */ - - vscode.window.onDidChangeActiveTextEditor - ( - async (textEditor : vscode.TextEditor) : Promise => - { - if (textEditor) - { - var document = textEditor.document; - if (document && document.isUntitled) - { - if (fileSetting[document.fileName]) - { - delete fileSetting[document.fileName]; - } - } - } - } - ); } }