Skip to content

automatic indent fails after EOF #2465

Closed
doda opened this Issue Oct 4, 2012 · 11 comments

5 participants

@doda
doda commented Oct 4, 2012
In [1]: for bla in bla:
   ...:     <- cursor here

In [1]:  <press Ctrl+d>
Do you really want to exit ([y]/n)? n

In [1]: for bla in bla:
   ...: <- cursor here
@mgaitan mgaitan added a commit to mgaitan/ipython that referenced this issue Oct 9, 2013
@mgaitan mgaitan dont reset readline_startup_hook on EOF. fix #2465 e746b69
@mgaitan
mgaitan commented Oct 9, 2013

Please, could you check if that is a valid solution?

@takluyver
IPython member

I suspect that the lines you removed in that commit were there for a reason - can you try to work out what that reason is or was?

@JustinL42 JustinL42 added a commit to JustinL42/ipython that referenced this issue Oct 9, 2013
@JustinL42 JustinL42 Test for Issue #2465 33b4cf5
@JustinL42 JustinL42 added a commit to JustinL42/ipython that referenced this issue Oct 9, 2013
@JustinL42 JustinL42 bug fix for Issue #2465 5436f8d
@mgaitan
@takluyver
IPython member

I suspect that's been there long enough that no-one remembers. So it would be a matter of digging in git logs, testing what happens when it's removed, and so on.

It looks like @JustinL42 is working on a different approach, though, so maybe it won't be necessary.

@JustinL42

If the lines are there for a reason or it proves too much trouble track it down the reason, there's always the conservative approach of adding the 'readline_startup_hook' back in if the user decides not to quit. But if it can be determined, taking them out is good too.

@mgaitan mgaitan added a commit to mgaitan/ipython that referenced this issue Oct 9, 2013
@JustinL42 JustinL42 Test for Issue #2465 492a04b
@mgaitan
mgaitan commented Oct 10, 2013

I realized that the conflictive line belongs to the dino's age.
6f629fc#diff-0ee313d04efaa60149a185d0062a0048R1383

May be @fperez could clarify what it was.

@takluyver
IPython member

Yep, I had a feeling that might be the case. And the actual line is even older than that commit, that's just a reorganisation. It may well be that whatever it was doing isn't still necessary, but I'm wary of just pulling it out without some idea of why it was put in.

@JustinL42

I'm wondering if the originally coder was concerned that the "do you really want to quit?" message might become indented with whatever the current indent level is. However, my terminal does not let me send EOF in the middle of an indented block, and I can't think of any other way to cause that particular bug.

@minrk minrk modified the milestone: wishlist, 3.0 Nov 14, 2014
@minrk minrk removed the prio-low label Jan 14, 2015
@takluyver
IPython member

I can't currently reproduce this - pressing Ctrl-D when the line is non-empty removes the character under the cursor, or does nothing if the cursor is at the end of the line. Anyone else?

@doda
doda commented Apr 14, 2015

It seems indeed that pressing Ctrl-D while indented does not work anymore ... bug fixed! :)

@doda doda closed this Apr 14, 2015
@minrk minrk modified the milestone: no action, wishlist Jun 10, 2015
@doda
doda commented Jul 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.