You are certainly right, and I agree that Ctrl-C would be simpler. John
On 17 January 2014 18:25, Simon King <[email protected]> wrote: > Hi John, > > On 2014-01-17, John Cremona <[email protected]> wrote: >>> This works for me as well. The problem only occurs when typing a new >>> definition, not when I go back to an old one. >>> >> >> Agreed. But when in the middle of the new definition you can type an >> up-arrow to chenge previous lines? I can even go back to the first >> line def f(): and then (in effect) start again. > > Let's see what happens. > > First step: I start to write a definition, hit return, and (of course) I > see this, with the cursor in the fourth position: > sage: def foo(x): > ....: > > Now, I notice that the function was supposed to be called "bar". If I > just hit the up-arrow, then a line that starts with blank spaces shows > up (result of an earlier cut-and-paste of a doctest)---no surprise, > since the cursor is in position four, hence, up-arrow seeks for the next > line in the history starting with four blank spaces. > > Hence, I go back to position 0 and hit the up-arrow again. Ineed, I now > get the previous line---but it is just a *copy* of the previous line. > Thus, this is what I see: > sage: def foo(x): > ....: def foo(x): > with the cursor right at the end of the second line. > > Now, I replace it by "def bar(x):" and hit return and complete the > definition. But alas, I get an error, since (of course) an indentation > is expected after the first line, that *still* is "def foo(x):": > sage: def foo(x): > ....: def bar(x): > ....: return x > ....: > File "<ipython-input-2-a2509f69cd36>", line 2 > def bar(x): > ^ > IndentationError: expected an indented block > > If you want to paste code into IPython, try the %paste and %cpaste magic > functions. > > Conclusion: I can *not* go back to the first line. All what I get is a > copy of the first line that is put into the second line. And I still > don't see a way to correct a line after hitting return. That's why > Ctrl-C used to be handy, because it made it possible to return to the > sage prompt, then use the up-arrow, and then edit the *whole* multiline > command, and that's why I think it is a bug that Ctrl-C does not return > to the prompt, in Sage-6.0. > > Best regards, > Simon > > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.
