#1835 add viewColumn property to TextEditor, not yet decided if we also need an event to signal changes

This commit is contained in:
Johannes Rieken
2016-01-21 12:05:02 +01:00
parent 8b2f434081
commit c14e864b2b
6 changed files with 122 additions and 12 deletions

View File

@@ -6,7 +6,7 @@
'use strict';
import * as assert from 'assert';
import {workspace, window} from 'vscode';
import {workspace, window, ViewColumn} from 'vscode';
import {join} from 'path';
import {cleanUp, pathEquals} from './utils';
@@ -14,7 +14,7 @@ suite("window namespace tests", () => {
teardown(cleanUp);
test('active text editor', () => {
test('editor, active text editor', () => {
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
return window.showTextDocument(doc).then((editor) => {
const active = window.activeTextEditor;
@@ -23,4 +23,20 @@ suite("window namespace tests", () => {
});
});
});
test('editor, assign and check view columns', () => {
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
let p1 = window.showTextDocument(doc, ViewColumn.One).then(editor => {
assert.equal(editor.viewColumn, ViewColumn.One);
});
let p2 = window.showTextDocument(doc, ViewColumn.Two).then(editor => {
assert.equal(editor.viewColumn, ViewColumn.Two);
});
let p3 = window.showTextDocument(doc, ViewColumn.Three).then(editor => {
assert.equal(editor.viewColumn, ViewColumn.Three);
});
return Promise.all([p1, p2, p3]);
});
});
});