New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer execution when there's only a single line entered #10489

Merged
merged 1 commit into from May 4, 2017

Conversation

Projects
None yet
3 participants
@takluyver
Member

takluyver commented Apr 26, 2017

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.

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.
@minrk

minrk approved these changes May 2, 2017

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk May 2, 2017

Member

AOK by me. Do you want to merge this as an incremental improvement, or keep thinking before landing this one?

Member

minrk commented May 2, 2017

AOK by me. Do you want to merge this as an incremental improvement, or keep thinking before landing this one?

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver May 4, 2017

Member

I think let's do this as an incrememental improvement (@Carreau seems enthusiastic, going by #10498 ), and I'll try to keep thinking about it.

Member

takluyver commented May 4, 2017

I think let's do this as an incrememental improvement (@Carreau seems enthusiastic, going by #10498 ), and I'll try to keep thinking about it.

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau May 4, 2017

Member
Member

Carreau commented May 4, 2017

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau May 4, 2017

Member
Member

Carreau commented May 4, 2017

@meeseeksdev meeseeksdev bot merged commit bbb0bc2 into ipython:master May 4, 2017

4 checks passed

codecov/patch 0% of diff hit (target 0%)
Details
codecov/project 66.53% (-0.01%) compared to fcbde47
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau May 4, 2017

Member

@meeseeksdev[bot] backport

Member

Carreau commented May 4, 2017

@meeseeksdev[bot] backport

meeseeksdev bot added a commit that referenced this pull request May 4, 2017

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.

takluyver added a commit that referenced this pull request May 4, 2017

@Carreau Carreau added the backported label May 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment