unction renderCaret(x) {
      canvasCtx.save();
      canvasCtx.fillStyle = CARET_COLOR;
      canvasCtx.fillRect(x, TEXT_ANCHOR_Y - CHAR_HEIGHT - CARET_PADDING, CARET_WIDTH, CHAR_HEIGHT + CARET_PADDING * 2);
      canvasCtx.restore();
    }

    function renderSelection(startX, endX) {
      canvasCtx.save();
      canvasCtx.fillStyle = SELECTION_COLOR;
      canvasCtx.fillRect(startX, TEXT_ANCHOR_Y - CHAR_HEIGHT - CARET_PADDING, endX - startX, CHAR_HEIGHT + CARET_PADDING * 2);
      canvasCtx.restore();
