From b0eecea45aa3c13053bed58d3c744067913424fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Thu, 3 Jan 2019 21:40:34 +0100 Subject: [PATCH] partially apply fast data access in InputHandler.print --- src/BufferLine.ts | 2 +- src/InputHandler.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BufferLine.ts b/src/BufferLine.ts index 7963934e..af838144 100644 --- a/src/BufferLine.ts +++ b/src/BufferLine.ts @@ -105,7 +105,7 @@ export class BufferLine implements IBufferLine { this._data[index * CELL_SIZE + Cell.FG], (content & Content.IS_COMBINED) ? this._combined[index] - : (cp) ? String.fromCharCode(cp) : '', + : (cp) ? stringFromCodePoint(cp) : '', content >> Content.WIDTH_SHIFT, (content & Content.IS_COMBINED) ? this._combined[index].charCodeAt(this._combined[index].length - 1) diff --git a/src/InputHandler.ts b/src/InputHandler.ts index bf8149b2..d19be5a1 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -435,14 +435,14 @@ export class InputHandler extends Disposable implements IInputHandler { } // write current char to buffer and advance cursor - bufferRow.set(buffer.x++, [curAttr, stringFromCodePoint(code), chWidth, code]); + bufferRow.setDataFromCodePoint(buffer.x++, code, chWidth, curAttr, 0); // fullwidth char - also set next cell to placeholder stub and advance cursor // for graphemes bigger than fullwidth we can simply loop to zero // we already made sure above, that buffer.x + chWidth will not overflow right if (chWidth > 0) { while (--chWidth) { - bufferRow.set(buffer.x++, [curAttr, '', 0, undefined]); + bufferRow.setDataFromCodePoint(buffer.x++, 0, 0, curAttr, 0); } } }