From 60a591e8c8a445ded42746e709bbfb5543ee5e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Sat, 12 Jan 2019 15:34:22 +0100 Subject: [PATCH] use getNullChar in InputHandler.print --- src/InputHandler.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 37583602..c41b4165 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -396,13 +396,10 @@ export class InputHandler extends Disposable implements IInputHandler { // insert mode: move characters to right if (insertMode) { // right shift cells according to the width - this._cell.fg = curAttr; - this._cell.bg = 0; - this._cell.content = 0; - bufferRow.insertCells(buffer.x, chWidth, this._cell); + bufferRow.insertCells(buffer.x, chWidth, buffer.getNullCell(curAttr)); // test last cell - since the last cell has only room for // a halfwidth char any fullwidth shifted there is lost - // and will be set to eraseChar + // and will be set to empty cell if (bufferRow.loadCell(cols - 1, this._cell).width === 2) { bufferRow.setDataFromCodePoint(cols - 1, NULL_CELL_CODE, NULL_CELL_WIDTH, curAttr, 0); } @@ -416,6 +413,7 @@ export class InputHandler extends Disposable implements IInputHandler { // we already made sure above, that buffer.x + chWidth will not overflow right if (chWidth > 0) { while (--chWidth) { + // other than a regular empty cell a cell following a wide char has no width bufferRow.setDataFromCodePoint(buffer.x++, 0, 0, curAttr, 0); } }