From: Daniel Imms Date: Wed, 1 Feb 2017 19:18:44 +0000 (-0800) Subject: Convert flags to enum X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=20f22fb658b0ddaf5a0dbf05b6517a51bf3f3136;p=mirror_xterm.js.git Convert flags to enum --- diff --git a/src/Renderer.ts b/src/Renderer.ts index d99f9be..9b6234c 100644 --- a/src/Renderer.ts +++ b/src/Renderer.ts @@ -11,16 +11,15 @@ import { ITerminal } from './Interfaces'; */ const MAX_REFRESH_FRAME_SKIP = 5; -// TODO: Convert flags to number enum /** - * Flags used to render terminal text properly + * Flags used to render terminal text properly. */ -const FLAGS = { - BOLD: 1, - UNDERLINE: 2, - BLINK: 4, - INVERSE: 8, - INVISIBLE: 16 +enum FLAGS { + BOLD = 1, + UNDERLINE = 2, + BLINK = 4, + INVERSE = 8, + INVISIBLE = 16 }; let brokenBold: boolean = null; @@ -118,9 +117,6 @@ export class Renderer { * @param {number} end The row to end at (between fromRow and terminal's height terminal - 1) */ private _refresh(start: number, end: number): void { - // TODO: Use fat arrow functions for callbacks to avoid `self` - let self = this; - let x, y, i, line, out, ch, ch_width, width, data, attr, bg, fg, flags, row, parent, focused = document.activeElement; // If this is a big refresh, remove the terminal rows from the DOM for faster calculations