use Text blur/focus events, #49125

This commit is contained in:
Johannes Rieken
2018-05-04 15:11:17 +02:00
parent fece020cc2
commit b74aa4461c
2 changed files with 16 additions and 2 deletions

View File

@@ -119,6 +119,20 @@ suite('window namespace tests', () => {
});
});
test('active editor not always correct... #49125', async function () {
const [docA, docB] = await Promise.all([
workspace.openTextDocument(await createRandomFile()),
workspace.openTextDocument(await createRandomFile()),
]);
for (let c = 0; c < 4; c++) {
let editorA = await window.showTextDocument(docA, ViewColumn.One);
assert(window.activeTextEditor === editorA);
let editorB = await window.showTextDocument(docB, ViewColumn.Two);
assert(window.activeTextEditor === editorB);
}
});
// test('issue #25801 - default column when opening a file', async () => {
// const [docA, docB, docC] = await Promise.all([
// workspace.openTextDocument(await createRandomFile()),

View File

@@ -178,8 +178,8 @@ class MainThreadDocumentAndEditorStateComputer {
private _onDidAddEditor(e: ICodeEditor): void {
this._toDisposeOnEditorRemove.set(e.getId(), e.onDidChangeModel(() => this._updateState()));
this._toDisposeOnEditorRemove.set(e.getId(), e.onDidFocusEditor(() => this._updateState()));
this._toDisposeOnEditorRemove.set(e.getId(), e.onDidBlurEditor(() => this._updateState()));
this._toDisposeOnEditorRemove.set(e.getId(), e.onDidFocusEditorText(() => this._updateState()));
this._toDisposeOnEditorRemove.set(e.getId(), e.onDidBlurEditorText(() => this._updateState()));
this._updateState();
}