code: function(pos) {
        if (posLess(pos, change.from)) return pos;
        if (!posLess(change.to, pos)) return end;
  
        var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;
        if (pos.line == change.to.line) ch += end.ch - change.to.ch;
        return Pos(line, ch);
      }
docs: hint is null, leave the selection alone as much as possible