Add middle of the line completion.
Clean up TODO.
Fix the bug when just pressing enter without any text.