(value, tr)
| 31 | return new Set(); |
| 32 | }, |
| 33 | update(value, tr) { |
| 34 | let next = value; |
| 35 | for (const e of tr.effects) { |
| 36 | if (e.is(toggleFold)) { |
| 37 | if (next === value) next = new Set(value); |
| 38 | const ln = e.value; |
| 39 | if (next.has(ln)) next.delete(ln); |
| 40 | else next.add(ln); |
| 41 | } |
| 42 | } |
| 43 | // Reset folds on full document reset |
| 44 | if (tr.docChanged && tr.startState.doc.length === 0) return new Set(); |
| 45 | return next; |
| 46 | }, |
| 47 | }); |
| 48 | |
| 49 | function eachGroup(doc, fn) { |
nothing calls this directly
no test coverage detected