Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 5c28b57

Browse files
committed
always recalculate position after doing transform step
as the amount of characters might not have changed, parts may still have been merged, removed or added which requires a new position.
1 parent 0273795 commit 5c28b57

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/editor/model.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ export default class EditorModel {
183183
this._setActivePart(newPosition, canOpenAutoComplete);
184184
if (this._transformCallback) {
185185
const transformAddedLen = this._transform(newPosition, inputType, diff);
186-
if (transformAddedLen !== 0) {
187-
newPosition = this.positionForOffset(caretOffset + transformAddedLen, true);
188-
}
186+
newPosition = this.positionForOffset(caretOffset + transformAddedLen, true);
189187
}
190188
this._updateInProgress = false;
191189
this._updateCallback(newPosition, inputType, diff);

0 commit comments

Comments
 (0)