The asynchronous part is due to CodeMirror polling. Brackets sees the "pending text" key and the `Enter` key before CodeMirror calls `readInput()`.

How to make the correct insertion could probably be figured out, but that's done in the Code Hint Provider `insertHint()` callback, so each provider would need to handle it.

I'm wondering if the more likely intent would be to insert the `Enter` key into the document (as opposed to selecting a hint from list). You have to be typing pretty fast to hit this (I have to really concentrate to hit this in cm slow poll mode) and wanting to select a change hints and then select it doesn't seem like a typical code hint user workflow.

FWIW, inserting `Enter` key in page (i.e. allowing key to bubble) whenever there is "pending text" is a simpler solution. There is no need for any of the Code Hint provider changes that I made in this branch.