From 7a01d1407f7042a8be65967fe7f62a41f4f06516 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 4 Sep 2019 15:57:29 +0200 Subject: [PATCH] make _replaceRange internal only --- src/editor/model.js | 4 ++-- src/editor/range.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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; }