message: don't extend segments ending in \n
diff: @@ -1701,7 +1701,7 @@ export function segmentTree(text: string): SegmentTree {
  }
  else {
  if ((!segment.child) && (segment.seq <= segmentWindow.minSeq) && (!segment.segmentGroup)) {
  - if (prevSegment && ((prevSegment.text.length <= TextSegmentGranularity) || (segment.text.length <= TextSegmentGranularity))) {
  + if (prevSegment && canExtendRight(prevSegment) && ((prevSegment.text.length <= TextSegmentGranularity) || (segment.text.length <= TextSegmentGranularity))) {
  extendSegment(prevSegment, segment);
  segment.parent = undefined;
  }
  @@ -1765,6 +1765,10 @@ export function segmentTree(text: string): SegmentTree {
  }
  }
  + function canExtendRight(segment: TextSegment) {
  + return (!segment.removedSeq)&&(segment.text.charAt(segment.text.length-1)!='\n');
  + }
  +
  // assume: both segments are leaves and have seq <= minSeq; segments not part of segment group
  function extendSegment(prevSegment: TextSegment, segment: TextSegment) {
  //console.log(`extending seq ${prevSegment.seq} text ${prevSegment.text} with seq ${segment.seq} text ${segment.text}`);
  