Skip to content

Commit

Permalink
🦋 設定コマンドで設定した内容が揮発してしまう問題の修正
Browse files Browse the repository at this point in the history
  • Loading branch information
wraith13 committed Mar 19, 2017
1 parent 2c48aa3 commit fe28eed
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> =>
{
if (textEditor)
{
var document = textEditor.document;
if (document && document.isUntitled)
{
if (fileSetting[document.fileName])
{
delete fileSetting[document.fileName];
}
}
}
}
);
}
}

Expand Down

0 comments on commit fe28eed

Please sign in to comment.