mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
use Text blur/focus events, #49125
This commit is contained in:
@@ -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()),
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user