remove experimental flag for recycling, merge with TypedArray setting

This commit is contained in:
Jörg Breitbart
2018-11-20 22:01:57 +01:00
parent 3964bb28b5
commit 15c4cc8a74
4 changed files with 5 additions and 13 deletions
+3 -4
View File
@@ -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 {
@@ -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()) {
@@ -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) {
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
-7
View File
@@ -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.
*/