Rename moveStart to moveStartForwards

So it it's clear what it does

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-04-18 10:18:49 +02:00
parent 609196a240
commit d36f8ccb95
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
2 changed files with 2 additions and 2 deletions

View File

@ -177,7 +177,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
// because we'll replace the whole range with an emoji,
// so move the start forward to the start of the emoticon.
// Take + 1 because index is reported without the possible preceding space.
range.moveStart(emoticonMatch.index + moveStart);
range.moveStartForwards(emoticonMatch.index + moveStart);
// and move end backwards so that we don't replace the trailing space/newline
range.moveEndBackwards(moveEnd);

View File

@ -32,7 +32,7 @@ export default class Range {
this._end = bIsLarger ? positionB : positionA;
}
moveStart(delta: number) {
moveStartForwards(delta: number) {
this._start = this._start.forwardsWhile(this.model, () => {
delta -= 1;
return delta >= 0;