mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
make sure default editor position is set, fixes #25801
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
import * as assert from 'assert';
|
||||
import { workspace, window, commands, ViewColumn, TextEditorViewColumnChangeEvent, Uri, Selection, Position, CancellationTokenSource, TextEditorSelectionChangeKind } from 'vscode';
|
||||
import { join } from 'path';
|
||||
import { cleanUp, pathEquals } from './utils';
|
||||
import { cleanUp, pathEquals, createRandomFile } from './utils';
|
||||
|
||||
suite('window namespace tests', () => {
|
||||
|
||||
@@ -110,6 +110,25 @@ suite('window namespace tests', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('issue #25801 - default column when opening a file', async () => {
|
||||
const [docA, docB, docC] = await Promise.all([
|
||||
workspace.openTextDocument(await createRandomFile()),
|
||||
workspace.openTextDocument(await createRandomFile()),
|
||||
workspace.openTextDocument(await createRandomFile())
|
||||
]);
|
||||
|
||||
await window.showTextDocument(docA, ViewColumn.One);
|
||||
await window.showTextDocument(docB, ViewColumn.Two);
|
||||
|
||||
assert.ok(window.activeTextEditor);
|
||||
assert.ok(window.activeTextEditor!.document === docB);
|
||||
assert.equal(window.activeTextEditor!.viewColumn, ViewColumn.Two);
|
||||
|
||||
await window.showTextDocument(docC);
|
||||
assert.ok(window.activeTextEditor!.document === docC);
|
||||
assert.equal(window.activeTextEditor!.viewColumn, ViewColumn.One);
|
||||
});
|
||||
|
||||
test('issue #5362 - Incorrect TextEditor passed by onDidChangeTextEditorSelection', (done) => {
|
||||
const file10Path = join(workspace.rootPath || '', './10linefile.ts');
|
||||
const file30Path = join(workspace.rootPath || '', './30linefile.ts');
|
||||
|
||||
Reference in New Issue
Block a user