support update callback setting selection instead of caret

This commit is contained in:
Bruno Windels 2019-09-04 16:04:06 +02:00
parent 037ac29c57
commit 2ea556e0b4
3 changed files with 40 additions and 10 deletions

View file

@ -433,7 +433,12 @@ export default class EditorModel {
*/
transform(callback) {
const pos = callback();
const acPromise = this._setActivePart(pos, true);
let acPromise = null;
if (!(pos instanceof Range)) {
acPromise = this._setActivePart(pos, true);
} else {
acPromise = Promise.resolve();
}
this._updateCallback(pos);
return acPromise;
}