Const enum over magic number
This commit is contained in:
@@ -22,6 +22,11 @@ interface ITerminalDimensions {
|
||||
const MINIMUM_COLS = 2;
|
||||
const MINIMUM_ROWS = 1;
|
||||
|
||||
// Must remain in sync with the value in core's viewport
|
||||
const enum Constants {
|
||||
DEFAULT_SCROLL_BAR_WIDTH = 14
|
||||
}
|
||||
|
||||
export class FitAddon implements ITerminalAddon , IFitApi {
|
||||
private _terminal: Terminal | undefined;
|
||||
|
||||
@@ -66,7 +71,7 @@ export class FitAddon implements ITerminalAddon , IFitApi {
|
||||
|
||||
const scrollbarWidth = (this._terminal.options.scrollback === 0
|
||||
? 0
|
||||
: (this._terminal.options.overviewRulerWidth || 14));
|
||||
: (this._terminal.options.overviewRulerWidth || Constants.DEFAULT_SCROLL_BAR_WIDTH));
|
||||
|
||||
const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement);
|
||||
const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));
|
||||
|
||||
Reference in New Issue
Block a user