Ensure `events.BUFFER_BEFORE_SWITCH` is emitted properly during `buffer.new()`. It appears that calling SCI_CREATEDOCUMENT alters view state immediately such that at least fold state is no longer available to store.
Ensure `events.BUFFER_BEFORE_SWITCH` is emitted properly during `buffer.new()`.
It appears that calling SCI_CREATEDOCUMENT alters view state immediately such
that at least fold state is no longer available to store.

rgieseke/textadept,rgieseke/textadept