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

Arduino IDE2.1.0 save as truncates the end of the file if it exceeds 64kb #2086

Closed
3 tasks done
David2153 opened this issue Jun 4, 2023 · 6 comments
Closed
3 tasks done
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@David2153
Copy link

Describe the problem

There seems to be a problem with the new IDE 2.1.0 editor when I try to copy a section of code from one sketch to another sketch using the standard right click COPY and PASTE. The copy and paste seems to work however I then use SAVEAS to save the new sketch into a new sketch/file and the file that is created is unexpectedly truncated (ie. missing lines of code at the bottom of the sketch). I have used this technique successfully on many occasions with the older IDE 1.8.19 without this issue.

To reproduce

  1. open an existing sketch
  2. open a second existing sketch
  3. highlight and COPY a section of code in the 1st sketch
  4. PASTE this section of code to the 2nd sketch
  5. SAVEAS the 2nd sketch to a new file name/location
  6. the saved file is unexpectedly truncated

Expected behavior

I'd expect the new sketch not to be truncated.

Arduino IDE version

2.1.0

Operating system

Windows

Operating system version

WIN10

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@David2153 David2153 added the type: imperfection Perceived defect in any part of project label Jun 4, 2023
@ubidefeo
Copy link

ubidefeo commented Jun 5, 2023

@David2153
I cannot reproduce this on Mac, I'll check with the rest of the team :)

@David2153
Copy link
Author

Further information.... the original compiled .ino file size is 28.4 kB for the two opened sketches and the saved to disk .ino file size is 101kB.
The truncated saved .ino file size is 65kB and it will not compile.
The sketches are intended for a UNO board.

@per1234 per1234 added the topic: code Related to content of the project itself label Jun 7, 2023
@David2153
Copy link
Author

Further information...... the problem seems related to file size. I tried the same process using smaller sketches and it worked as it should. I tried it again using the larger sketches where I initially observed the problem and it failed again. I have expanded/clarified the "To Reproduce" procedure below.

  1. open an existing sketch
  2. open a second existing sketch
  3. using a mouse, highlight and right click COPY a section of code in the 1st sketch
  4. using a mouse, highlight the section of code in the second sketch to be replaced with the clipboard contents
  5. right click PASTE the clipboard contents to the highlighted code in the second sketch
  6. the COPY and PASTE appears to work OK with no lost lines of code at the bottom of the sketch
  7. SAVE AS the 2nd sketch to a new file name/location
  8. the saved file is unexpectedly truncated

@kittaakos
Copy link
Contributor

Thank you for taking the time and writing the bug report.

I could reproduce the bug with 2.1.0 when the file size exceeds 64kb. Upstream issue: eclipse-theia/theia#12406.

We have fixed this by updating the version of the underlying Theia IDE framework in IDE2. See #2027.

Please try with the nightly build and let us know if the defect is still present. You can download the nightly IDE2 builds from https://www.arduino.cc/en/software#nightly-builds.

I also downloaded IDE2 nightly (2.1.1-nightly-20230607), which worked for me locally. 2.1.0 does not. I appreciate your help.

@kittaakos kittaakos added the status: waiting for information More information must be provided before work can proceed label Jun 7, 2023
@David2153
Copy link
Author

The latest nightly version has fixed the issue. Thanks.

@per1234 per1234 removed the status: waiting for information More information must be provided before work can proceed label Jun 8, 2023
@per1234
Copy link
Contributor

per1234 commented Jun 8, 2023

Thanks for the follow-up @David2153.

Closing as resolved by #2027.

@per1234 per1234 closed this as completed Jun 8, 2023
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jun 8, 2023
@kittaakos kittaakos changed the title Arduino IDE2.1.0 editor issue Arduino IDE2.1.0 save as truncates the end of the file if it exceeds 64kb Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

4 participants