message: Fix bugs in textOffsetsToSelectionState
  This just had some thinkos in it. Namely the conditionals were slightly wrong and this lead to negative offset selection state being returned, causing vector-im/riot-web#4792
  fixes vector-im/riot-web#4792
diff: @@ -204,7 +204,8 @@ export function textOffsetsToSelectionState({start, end}: SelectionRange,
  let selectionState = SelectionState.createEmpty();
  for (const block of contentBlocks) {
  const blockLength = block.getLength();
  - if (start !== -1 && start < blockLength) {
  + if (start !== -1) {
  + if (start < blockLength + 1) {
  selectionState = selectionState.merge({
  anchorKey: block.getKey(),
  anchorOffset: start,
  @@ -213,7 +214,9 @@ export function textOffsetsToSelectionState({start, end}: SelectionRange,
  } else {
  start -= blockLength + 1; // +1 to account for newline between blocks
  }
  - if (end !== -1 && end <= blockLength) {
  + }
  + if (end !== -1) {
  + if (end < blockLength + 1) {
  selectionState = selectionState.merge({
  focusKey: block.getKey(),
  focusOffset: end,
  @@ -223,6 +226,7 @@ export function textOffsetsToSelectionState({start, end}: SelectionRange,
  end -= blockLength + 1; // +1 to account for newline between blocks
  }
  }
  + }
  return selectionState;
  }
  