tomviz icon indicating copy to clipboard operation
tomviz copied to clipboard

Pasting into python editor sometimes results in duplicated code

Open psavery opened this issue 6 years ago • 1 comments

If I try to copy and paste a line of code from a website into the python editor, it sometimes duplicates all of the code up to the line where I pasted, and deletes all the code after the line where I pasted.

For instance, if the function is this:

def transform(dataset):

    import numpy as np

    array = dataset.active_scalars
    result = np.sqrt(array)
    dataset.active_scalars = result

And if I copy and paste array = np.square(array) into a new line right before the np.sqrt(), I end up with:

def transform(dataset):

    import numpy as np

    array = dataset.active_scalars
    array = np.square(array)


def transform(dataset):

    import numpy as np

    array = dataset.active_scalars
    array = np.square(array)

The code after the pasted part is gone, and it is replaced with a copy of all the code up to (and including) the pasted line.

This is happening on my local build of tomviz on Ubuntu 18.04.

psavery avatar Oct 28 '19 18:10 psavery

I have seen this occasionally, but I am not sure if this is a Tomviz bug, or something in Qt/ParaView code. It would be good to get to the root of.

cryos avatar Dec 09 '19 19:12 cryos