mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
remove experimental flag for recycling, merge with TypedArray setting
This commit is contained in:
+3
-4
@@ -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) {
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
Vendored
-7
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user