1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

Rename moveStart to moveStartForwards

So it it's clear what it does

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-04-18 10:18:49 +02:00
parent 609196a240
commit d36f8ccb95
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;