diff --git a/src/editor/model.js b/src/editor/model.js index 34a796f733..a121c67b48 100644 --- a/src/editor/model.js +++ b/src/editor/model.js @@ -401,8 +401,8 @@ export default class EditorModel { return new Range(this, positionA, positionB); } - //mostly internal, called from Range.replace - replaceRange(startPosition, endPosition, parts) { + // called from Range.replace + _replaceRange(startPosition, endPosition, parts) { // convert end position to offset, so it is independent of how the document is split into parts // which we'll change when splitting up at the start position const endOffset = endPosition.asOffset(this); diff --git a/src/editor/range.js b/src/editor/range.js index 0739cd7842..822c3b13a7 100644 --- a/src/editor/range.js +++ b/src/editor/range.js @@ -58,7 +58,7 @@ export default class Range { this._start.iteratePartsBetween(this._end, this._model, (part, startIdx, endIdx) => { oldLength += endIdx - startIdx; }); - this._model.replaceRange(this._start, this._end, parts); + this._model._replaceRange(this._start, this._end, parts); return newLength - oldLength; }