make _replaceRange internal only

pull/21833/head
Bruno Windels 2019-09-04 15:57:29 +02:00
parent 4c04bc19c9
commit 7a01d1407f
2 changed files with 3 additions and 3 deletions

View File

@ -401,8 +401,8 @@ export default class EditorModel {
return new Range(this, positionA, positionB); return new Range(this, positionA, positionB);
} }
//mostly internal, called from Range.replace // called from Range.replace
replaceRange(startPosition, endPosition, parts) { _replaceRange(startPosition, endPosition, parts) {
// convert end position to offset, so it is independent of how the document is split into 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 // which we'll change when splitting up at the start position
const endOffset = endPosition.asOffset(this); const endOffset = endPosition.asOffset(this);

View File

@ -58,7 +58,7 @@ export default class Range {
this._start.iteratePartsBetween(this._end, this._model, (part, startIdx, endIdx) => { this._start.iteratePartsBetween(this._end, this._model, (part, startIdx, endIdx) => {
oldLength += endIdx - startIdx; oldLength += endIdx - startIdx;
}); });
this._model.replaceRange(this._start, this._end, parts); this._model._replaceRange(this._start, this._end, parts);
return newLength - oldLength; return newLength - oldLength;
} }