support icon indicating copy to clipboard operation
support copied to clipboard

[Bug] Copy pasting generated Python code

Open Devansh-awat opened this issue 1 year ago • 1 comments

Describe the bug Python files turning into block files

To reproduce

  1. Copy a Python code from the read-only editor in blocks programming
  2. Create a new Python project and paste the code
  3. Go to another file
  4. Come back to the new file
  5. The file will now be a block file

Expected behaviour The Python file should have stayed a Python file

Video recording

https://github.com/user-attachments/assets/a0569722-3c2b-4747-b4e7-d2608e9a4c2f

Devansh-awat avatar Oct 15 '24 16:10 Devansh-awat

Thanks for reporting.

Block programs are Python files with the block representation stored as a comment on the first line.

When you copied the code, it also copied that first line. This isn't visible in your video, but you will see it if you scroll to the first line after pasting it in a new file. You can delete that first line to work around it.

laurensvalk avatar Oct 15 '24 17:10 laurensvalk