Tweak auto-completion

Allow new lines to be entered before a line that auto-completes by requiring the cursor be at the end of the line first.

Fixes #41