Made it so search results can be added to the message you're writing. It replaces the query you typed with the reference to the unit you choose.
Adjusted the way references look as well.
Also worked quite a bit on setting focus correctly in the text editor for a variety of edge cases. Still a bit more to do but nearly there I think.