use getNullChar in InputHandler.print
This commit is contained in:
+3
-5
@@ -396,13 +396,10 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|||||||
// insert mode: move characters to right
|
// insert mode: move characters to right
|
||||||
if (insertMode) {
|
if (insertMode) {
|
||||||
// right shift cells according to the width
|
// right shift cells according to the width
|
||||||
this._cell.fg = curAttr;
|
bufferRow.insertCells(buffer.x, chWidth, buffer.getNullCell(curAttr));
|
||||||
this._cell.bg = 0;
|
|
||||||
this._cell.content = 0;
|
|
||||||
bufferRow.insertCells(buffer.x, chWidth, this._cell);
|
|
||||||
// test last cell - since the last cell has only room for
|
// test last cell - since the last cell has only room for
|
||||||
// a halfwidth char any fullwidth shifted there is lost
|
// 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) {
|
if (bufferRow.loadCell(cols - 1, this._cell).width === 2) {
|
||||||
bufferRow.setDataFromCodePoint(cols - 1, NULL_CELL_CODE, NULL_CELL_WIDTH, curAttr, 0);
|
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
|
// we already made sure above, that buffer.x + chWidth will not overflow right
|
||||||
if (chWidth > 0) {
|
if (chWidth > 0) {
|
||||||
while (--chWidth) {
|
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);
|
bufferRow.setDataFromCodePoint(buffer.x++, 0, 0, curAttr, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user