Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public apply({ tr, newState }: TransactionParams & CompareStateParams) {
const { exit } = this.handlerMatches;
if (!transactionChanged(tr) && !this.removed) {
return this;
}
this.mapIgnoredDecorations(tr);
// If the previous run was an exit reset the suggestion matches
if (exit) {
this.resetState();
}
this.prev = this.next;
// Match against the current selection position
this.updateReasons({ $pos: tr.selection.$from, state: newState });
return this;