mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Fix review comments
This commit is contained in:
+3
-3
@@ -11,7 +11,7 @@ export const CHAR_DATA_ATTR_INDEX = 0;
|
||||
export const CHAR_DATA_CHAR_INDEX = 1;
|
||||
export const CHAR_DATA_WIDTH_INDEX = 2;
|
||||
export const CHAR_DATA_CODE_INDEX = 3;
|
||||
export const MAX_BUFFER_SIZE = -1 >>> 0; // 2^32 - 1
|
||||
export const MAX_BUFFER_SIZE = 4294967295; // 2^32 - 1
|
||||
|
||||
/**
|
||||
* This class represents a terminal buffer (an internal state of the terminal), where the
|
||||
@@ -70,9 +70,9 @@ export class Buffer implements IBuffer {
|
||||
return rows;
|
||||
}
|
||||
|
||||
const correctBuferLength = rows + this._terminal.options.scrollback;
|
||||
const correctBufferLength = rows + this._terminal.options.scrollback;
|
||||
|
||||
return correctBuferLength > MAX_BUFFER_SIZE ? MAX_BUFFER_SIZE : correctBuferLength;
|
||||
return correctBufferLength > MAX_BUFFER_SIZE ? MAX_BUFFER_SIZE : correctBufferLength;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -384,7 +384,7 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
||||
}
|
||||
break;
|
||||
case 'scrollback':
|
||||
value = value > 0 && value <= MAX_BUFFER_SIZE ? value : MAX_BUFFER_SIZE;
|
||||
value = Math.min(value, MAX_BUFFER_SIZE);
|
||||
|
||||
if (value < 0) {
|
||||
console.warn(`${key} cannot be less than 0, value: ${value}`);
|
||||
|
||||
Reference in New Issue
Block a user