Ace2Inner: Inline code that is unnecessarily inside an IIFE
parent
4890cd8972
commit
788eb86d84
|
@ -1475,27 +1475,25 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
throw new Error(`doRepApplyChangeset length mismatch: ${errMsg}`);
|
throw new Error(`doRepApplyChangeset length mismatch: ${errMsg}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
((changes) => {
|
const editEvent = currentCallStack.editEvent;
|
||||||
const editEvent = currentCallStack.editEvent;
|
if (editEvent.eventType === 'nonundoable') {
|
||||||
if (editEvent.eventType === 'nonundoable') {
|
if (!editEvent.changeset) {
|
||||||
if (!editEvent.changeset) {
|
editEvent.changeset = changes;
|
||||||
editEvent.changeset = changes;
|
|
||||||
} else {
|
|
||||||
editEvent.changeset = Changeset.compose(editEvent.changeset, changes, rep.apool);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
const inverseChangeset = Changeset.inverse(changes, {
|
editEvent.changeset = Changeset.compose(editEvent.changeset, changes, rep.apool);
|
||||||
get: (i) => `${rep.lines.atIndex(i).text}\n`,
|
|
||||||
length: () => rep.lines.length(),
|
|
||||||
}, rep.alines, rep.apool);
|
|
||||||
|
|
||||||
if (!editEvent.backset) {
|
|
||||||
editEvent.backset = inverseChangeset;
|
|
||||||
} else {
|
|
||||||
editEvent.backset = Changeset.compose(inverseChangeset, editEvent.backset, rep.apool);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})(changes);
|
} else {
|
||||||
|
const inverseChangeset = Changeset.inverse(changes, {
|
||||||
|
get: (i) => `${rep.lines.atIndex(i).text}\n`,
|
||||||
|
length: () => rep.lines.length(),
|
||||||
|
}, rep.alines, rep.apool);
|
||||||
|
|
||||||
|
if (!editEvent.backset) {
|
||||||
|
editEvent.backset = inverseChangeset;
|
||||||
|
} else {
|
||||||
|
editEvent.backset = Changeset.compose(inverseChangeset, editEvent.backset, rep.apool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Changeset.mutateAttributionLines(changes, rep.alines, rep.apool);
|
Changeset.mutateAttributionLines(changes, rep.alines, rep.apool);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue