[closebrackets addon] Adjust to multi-selections
And fix example code in demo. Issue #778
Change TextMarker.find to allow more control over result
And use this to cut some indirection in its callers.
Change data structure used to track rendered lines
Simplifies updateDisplay, remove lineObj property on DOM nodes. Prepares the way for smarter updating, and maybe smarter measuring. Breaks updating of lines without redrawing their widgets (which I intend to implement in a better way in a subsequent patch).
Implement (somewhat) intelligent updating of lines
Changes to text, widgets, classes, and gutter are now separated. For individual line changes, the DOM is updated for only the change, rather than doing a full redraw on the line.
Uses regular rendered lines, rather than a custom one-span-per-char rendering, to measure lines. Also makes rendering incremental -- no longer measures all characters in a single go, but rather measures as-needed. In this commit, the new model is implemented alongside the old one. Subsequent commits will rip out the old code.