Ace2Inner: Inline code that is unnecessarily inside an IIFE

pull/5221/head
Richard Hansen 2021-03-21 17:57:32 -04:00
parent 4890cd8972
commit 788eb86d84
1 changed files with 17 additions and 19 deletions

View File

@ -1475,27 +1475,25 @@ function Ace2Inner(editorInfo, cssManagers) {
throw new Error(`doRepApplyChangeset length mismatch: ${errMsg}`);
}
((changes) => {
const editEvent = currentCallStack.editEvent;
if (editEvent.eventType === 'nonundoable') {
if (!editEvent.changeset) {
editEvent.changeset = changes;
} else {
editEvent.changeset = Changeset.compose(editEvent.changeset, changes, rep.apool);
}
const editEvent = currentCallStack.editEvent;
if (editEvent.eventType === 'nonundoable') {
if (!editEvent.changeset) {
editEvent.changeset = 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);
}
editEvent.changeset = Changeset.compose(editEvent.changeset, changes, 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);