Backport PR
#10489: Prefer execution when there's only a single line entered...
Backport PR
#10489: Prefer execution when there's only a single line entered
Closes gh-10425
The heuristic here is to treat a single line specially, and always evaluate it as if the cursor was at the end. An alternative heuristic could be to do this if the cursor is on the last line of the input.
This could also cause some weird effects if you e.g. type `for a in range(5):`, move the cursor back a few places and press enter - you'll get a newline inserted in the text, but it will indent as if it were after the colon. I'm still trying to think if there's a better way to approach it.