Fix problem in clipping the view for changes

To account for the fact that the set of folded lines might be
different post-change and pre-change.
Fix delayed update of scroll height

Due to some elements still being stuck at the old height.
Initialize doc before display

Slightly simplifies constructor logic.