    if (newPos < 0) {
          newPos = 0;
        }

        if (e.shiftKey) {
          editContext.updateSelection(newPos, editContext.selectionEnd);
        } else {
          editContext.updateSelection(newPos, newPos);
        }
      } else if (e.key == "ArrowRight") {
        const newPos = editContext.selectionEnd + 1;
        if (newPos > editContext.text.length) {
          newPos = editContext.text.length;
        }

        if (e.shiftKey) {
          editContext.updateSelection(editContext.se