Add `OpenTextEditor` event

Includes a new threadsafe function to get the text contents from a TextEditorRef. This probably has potential for a TOCTOU bug, but I'm not sure how to avoid this without unnecessary calls to Document::get_text() every time the visible editor changes.

Created by  finchie  yesterday at 18:53
M5RW5PN4VFYZOKHUFMVWR2XAUAXHUYROVZFTS3RIE7AAUGTVHAEQC
Change contents