Skip to content
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

Copy/Paste stripping broken in version > 0.13.x in QTConsole #4728

Closed
ghost opened this issue Dec 21, 2013 · 3 comments
Closed

Copy/Paste stripping broken in version > 0.13.x in QTConsole #4728

ghost opened this issue Dec 21, 2013 · 3 comments
Milestone

Comments

@ghost
Copy link

ghost commented Dec 21, 2013

This bug has kept me on 0.13.x for as long as I can remember. Every time
I decided to open a bug report I'd fire up QTconsole and make sure it
wasn't fixed in master already. And evertyime It was. And I would happily switch,
and in a day or so the bug always reappeard, and It seemed as if I was losing my mind.

Gladly, not so. Finally nailed it.

When Ipython is in the following state:

In [1]: """
   ...: just
   ...: some
   ...: foo
   ...: and bar
   ...: """

Marking the entire context with mouse and copying removes the leading
dots and let's you paste your code into your code editor. As it should.

In [2]: """
   ...: just
   ...: some
   ...: foo
   ...: and bar
   ...: """

That works too.

In [10]: """
   ...: just
   ...: some
   ...: foo
   ...: and bar
   ...: """

This only strips the prompt from the first line. See it?

Months. Literally Months to figure this out.

Related #3323, #3206

cc @takluyver

@takluyver
Copy link
Member

The only difference being that the prompt has gone into double digits, right? That's rather bizarre, but I can reproduce it.

@takluyver
Copy link
Member

Oh, I bet I've got it. The regex for the ...: continuation prompts has a fixed number of spaces, but it should be variable. Actually, both the number of spaces and the number of dots should be able to expand, because in the terminal we add extra dots instead of extra spaces.

Nice catch, by the way :-)

@ghost
Copy link
Author

ghost commented Dec 21, 2013

One more:

    ...:     clabels=zip(*df.columns.tolist())
    ...:     n_rlvls =df.index.nlevels
    ...:     n_clvls =df.columns.nlevels
    ...:     head=[]

If copy just the middle of a cell and paste it, the dots don't seem to get stripped.
These are seemingly silly things, but In practice my whole workflow depends on copying and pasting code
I work on in ipython iteratively.

takluyver added a commit to takluyver/ipython that referenced this issue Dec 21, 2013
jdfreder pushed a commit to jdfreder/ipython that referenced this issue Jan 2, 2014
jdfreder pushed a commit to jdfreder/ipython that referenced this issue Jan 2, 2014
Closes ipythongh-4728

Thanks to the excellent detective work by @y-p, this was an easy fix.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Closes ipythongh-4728

Thanks to the excellent detective work by @y-p, this was an easy fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant