Skip to content

Commit

Permalink
remove experimental flag for recycling, merge with TypedArray setting
Browse files Browse the repository at this point in the history
  • Loading branch information
jerch committed Nov 20, 2018
1 parent 3964bb2 commit 15c4cc8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
7 changes: 3 additions & 4 deletions src/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ const DEFAULT_OPTIONS: ITerminalOptions = {
theme: null,
rightClickSelectsWord: Browser.isMac,
rendererType: 'canvas',
experimentalBufferLineImpl: 'JsArray',
experimentalBufferLineRecycling: false
experimentalBufferLineImpl: 'JsArray'
};

export class Terminal extends EventEmitter implements ITerminal, IDisposable, IInputHandlingTerminal {
Expand Down Expand Up @@ -1181,7 +1180,7 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
*/
public scroll(isWrapped: boolean = false): void {
let newLine: IBufferLine;
const useRecycling = this.options.experimentalBufferLineRecycling;
const useRecycling = this.options.experimentalBufferLineImpl === 'TypedArray';
if (useRecycling) {
newLine = this._blankLine;
if (!newLine || newLine.length !== this.cols || newLine.get(0)[CHAR_DATA_ATTR_INDEX] !== this.eraseAttr()) {
Expand All @@ -1198,7 +1197,7 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II

if (this.buffer.scrollTop === 0) {
// Determine whether the buffer is going to be trimmed after insertion.
const willBufferBeTrimmed = this.buffer.lines.isFull();
const willBufferBeTrimmed = this.buffer.lines.isFull;

// Insert the line using the fastest method
if (bottomRow === this.buffer.lines.length - 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/common/CircularList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class CircularList<T> extends EventEmitter implements ICircularList<T> {
/**
* Ringbuffer is at max length.
*/
public isFull(): boolean {
public get isFull(): boolean {
return this._length === this._maxLength;
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export interface IKeyboardEvent {
export interface ICircularList<T> extends IEventEmitter {
length: number;
maxLength: number;
isFull: boolean;

get(index: number): T | undefined;
set(index: number, value: T): void;
push(value: T): void;
recycle(): T | undefined;
isFull(): boolean;
pop(): T | undefined;
splice(start: number, deleteCount: number, ...items: T[]): void;
trimStart(count: number): void;
Expand Down
7 changes: 0 additions & 7 deletions typings/xterm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,6 @@ declare module 'xterm' {
*/
experimentalBufferLineImpl?: 'JsArray' | 'TypedArray';

/**
* (EXPERIMENTAL) Enable recycling of buffer lines.
*
* This option will be removed in the future.
*/
experimentalBufferLineRecycling?: boolean;

/**
* The font size used to render text.
*/
Expand Down

0 comments on commit 15c4cc8

Please sign in to comment.