From 1c3028c59f9afb4623c93d142aedb9ffc49b4cd6 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 4 Sep 2017 09:23:14 -0700 Subject: [PATCH] Work around an emoji bug --- src/renderer/ForegroundRenderLayer.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/renderer/ForegroundRenderLayer.ts b/src/renderer/ForegroundRenderLayer.ts index 71168f26..ef9c3c60 100644 --- a/src/renderer/ForegroundRenderLayer.ts +++ b/src/renderer/ForegroundRenderLayer.ts @@ -93,6 +93,13 @@ export class ForegroundRenderLayer extends BaseRenderLayer { // If the character is an emoji and the character to the right is a // space, take ownership of the cell to the right. if (this._isEmoji(char)) { + // If the character is an emoji, we want to force a re-render on every + // frame. This is specifically to work around the case where two + // emoji's `a` and `b` are adjacent, the cursor is moved to b and a + // space is added. Without this, the first half of `b` would never + // get removed, and `a` would not re-render because it thinks it's + // already in the correct state. + this._state.cache[x][y] = EMOJI_OWNED_CHAR_DATA; if (x < line.length && line[x + 1][CHAR_DATA_CODE_INDEX] === 32 /*' '*/) { width = 2; this._clearChar(x + 1, y);