Content length limit (CodeMirror6)

Thanks.

I feel like there is a better way to do this. :grimacing: Any tips?

function lengthLimit(tr: Transaction): boolean {
  return (tr.startState?.doc?.length + tr.changes?.inserted?.length) < MAX_LENGTH;
}