From 0d02ab59d68c1700ca78326683daf98c2a062d4e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 3 Sep 2019 16:00:50 +0200 Subject: [PATCH] allow starting a range with both positions known already we'll need this to start a range for the selection --- src/editor/model.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/editor/model.js b/src/editor/model.js index 613be5b4bd..75ab1d7706 100644 --- a/src/editor/model.js +++ b/src/editor/model.js @@ -394,11 +394,12 @@ export default class EditorModel { /** * Starts a range, which can span across multiple parts, to find and replace text. - * @param {DocumentPosition} position where to start the range + * @param {DocumentPosition} positionA a boundary of the range + * @param {DocumentPosition?} positionB the other boundary of the range, optional * @return {Range} */ - startRange(position) { - return new Range(this, position); + startRange(positionA, positionB = positionA) { + return new Range(this, positionA, positionB); } //mostly internal, called from Range.replace