Move CharWidth into common

This commit is contained in:
Daniel Imms
2019-06-08 11:35:52 -07:00
parent e758a78f2e
commit 1546e0c12d
5 changed files with 4 additions and 5 deletions
-1
View File
@@ -5,7 +5,6 @@
import * as puppeteer from 'puppeteer';
import { assert } from 'chai';
// import { getStringCellWidth } from './CharWidth';
import { ITerminalOptions } from 'xterm';
const APP = 'http://127.0.0.1:3000/test';
+1 -1
View File
@@ -7,7 +7,7 @@
import { IInputHandler, IInputHandlingTerminal } from './Types';
import { C0, C1 } from 'common/data/EscapeSequences';
import { CHARSETS, DEFAULT_CHARSET } from 'core/data/Charsets';
import { wcwidth } from './CharWidth';
import { wcwidth } from './common/CharWidth';
import { EscapeSequenceParser } from 'core/parser/EscapeSequenceParser';
import { IDisposable } from 'xterm';
import { Disposable } from 'common/Lifecycle';
+1 -1
View File
@@ -5,7 +5,7 @@
import { ILinkifierEvent, ILinkMatcher, LinkMatcherHandler, ILinkMatcherOptions, ILinkifier, ITerminal, IBufferStringIteratorResult, IMouseZoneManager } from './Types';
import { MouseZone } from './MouseZoneManager';
import { getStringCellWidth } from './CharWidth';
import { getStringCellWidth } from 'common/CharWidth';
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
/**
@@ -4,7 +4,7 @@
*/
import { assert } from 'chai';
import { wcwidth } from './CharWidth';
import { wcwidth } from 'common/CharWidth';
it('wcwidth should match all values from the old implementation', function(): void {
// old implementation
@@ -125,7 +125,7 @@ it('wcwidth should match all values from the old implementation', function(): vo
return 1;
}
const control = opts.control | 0;
let table: number[] | Uint32Array = null;
let table: number[] | Uint32Array | undefined;
function initTable(): number[] | Uint32Array {
// lookup table for BMP
const CODEPOINTS = 65536; // BMP holds 65536 codepoints