mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-22 06:51:21 +02:00
allow starting a range with both positions known already
we'll need this to start a range for the selection
This commit is contained in:
parent
eb87301855
commit
0d02ab59d6
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user