make cols mandatory in BufferLine ctor

This commit is contained in:
Jörg Breitbart
2018-09-01 00:18:52 +02:00
parent f3561fad30
commit 024404f548
4 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ class TestBufferLine extends BufferLine {
describe('BufferLine', function(): void {
it('ctor', function(): void {
let line: IBufferLine = new TestBufferLine();
let line: IBufferLine = new TestBufferLine(0);
chai.expect(line.length).equals(0);
chai.expect(line.isWrapped).equals(false);
line = new TestBufferLine(10);
+2 -2
View File
@@ -17,7 +17,7 @@ export class BufferLineOld implements IBufferLine {
public isWrapped = false;
public length: number;
constructor(cols?: number, ch?: CharData, isWrapped?: boolean) {
constructor(cols: number, ch?: CharData, isWrapped?: boolean) {
this._data = [];
this.length = this._data.length;
if (cols) {
@@ -111,7 +111,7 @@ export class BufferLine implements IBufferLine {
protected _combined: {[index: number]: string} = {};
public length: number;
constructor(cols?: number, ch?: CharData, public isWrapped: boolean = false) {
constructor(cols: number, ch?: CharData, public isWrapped: boolean = false) {
this.length = cols || 0;
if (cols) {
if (!ch) {
-3
View File
@@ -516,9 +516,6 @@ export interface IBufferLine {
isWrapped: boolean;
get(index: number): CharData;
set(index: number, value: CharData): void;
// pop(): CharData | undefined;
// push(data: CharData): void;
// splice(start: number, deleteCount: number, ...items: CharData[]): CharData[];
insertCells(pos: number, n: number, ch: CharData): void;
deleteCells(pos: number, n: number, fill: CharData): void;
replaceCells(start: number, end: number, fill: CharData): void;
+1 -1
View File
@@ -21,7 +21,7 @@ describe('CharacterJoinerRegistry', () => {
lines.set(2, lineData([['a -> b -', 0xFFFFFFFF], ['> c -> d', 0]]));
lines.set(3, lineData([['no joined ranges']]));
lines.set(4, new BufferLine());
lines.set(4, new BufferLine(0));
lines.set(5, lineData([['a', 0x11111111], [' -> b -> c -> '], ['d', 0x22222222]]));
const line6 = lineData([['wi']]);
line6.resize(line6.length + 1, [0, '¥', 2, '¥'.charCodeAt(0)]);