Losing code, Editor quirks

@West - just installed 13.2.2 but haven’t had chance to check it out yet. Fingers, legs and eyes crossed!!!

Hi @Simeon , hope all is well. Any update on this? I realize that not always what I want is highest priority for others, of course, so I’ll try to be patient. That said, I’m hoping to get back the pre-3.0 stability of the editor and code saving. Thanks!

I’ve not had a crash since the iOS update

I’m still getting the code-not-being-saved issue on the latest OS.

Is Codea crashing when you have a problem with the code being saved. So far the only time I notice a problem with the code is when Codea crashes.

I’m not getting any crashes. I’m getting times when changes to the code are not being saved (and so Codea runs an old version of the code - that’s usually how I spot it). I have to go out of the current program, load another one, and then go back to the original. Then I have to make all my lost changes again. But no crashes.

@LoopSpace Are you using the Save and Run option by long pressing the run icon in the upper right of the editor screen. Are your changes in a tab other than the Main tab. I posted an example some time ago where I showed where changes in a tab other than Main took about 10 seconds before it was updates.

@dave1707 I am not currently using the Save and Run option because when I did use it then it didn’t make any difference. I’ll try again to see if that makes a difference with the current version of the OS. My changes are in the Main tab, though.

Code loss, with and without crashes, changes beyond the main tab. Save and run does not fix the issue for me. Admittedly, this was before the latest iOS update, but I have my doubts that there’s a iOS bug that’s causing filesystem issues here but not elsewhere, with other apps. Codea 3.0 code editor issues also are most likely problems within Codea itself.

Happy to say that lately I haven’t had the issues referenced in this thread. Not sure what ‘fixed’ it (os updates, Codea updates, storing projects again directly in Codea folder (well, in their own folder now!) and syncing Working Copy to the project folder), but feeling good again.

But hey, how ‘bout mentioning two pet peeve issues that have always been a bit of an annoyance - all in the name of making my favorite app all the better:

  1. I still get an audio ‘hiccup’ when switching in or out of Codea. Or, I will be listening to music, exit a running Codea program, and my music comes out of the iPad speakers instead of staying in my headphones. I have to unplug/replug my headphones to get them working again.

  2. On the first (and only) line of a new tab/file, tapping an autocomplete suggestion does not work. Example: In a new tab, on the very first line, begin typing function. Try to complete the word by tapping the function autocomplete suggestion. It does not work.

@Simeon I’m disappointed to be reporting that I again hit a point where my code changes are not saving. I will start my program, wonder why its acting a certain way, only to go back to the editor and see that my changes are not there.

Unfortunately, I still have no way reliably reproduce this. I can say this: today is the first day in awhile where I had sustained programming time in Codea, in the same project. Easily over two hours. No app crashes during that time. There may have been a few times where I exited the project to zip and commit in Working Copy, but for the most part, I worked in the editor.

The project isn’t very large (1000 sloc, is a very rough estimate, 5 tabs, ~7mb Data.plist file (all my svg path data), one dependency…but it had been working great most of the time. Then it just started refusing to keep my changes.

This is 3.1(202) - the beta version, I believe?

Again, not expecting any miracle fixes, since I can’t figure any way to make this happen for others…but wanted to put it on your radar.

@brianolive hmm you should be on 3.1 (208), which is the last beta and also the release version

Thank you for posting this, though.

Do you find the editor loses it’s auto-indentation behaviour when this happens?

If you long-press on the play button you can choose “Save & Run” which forces a save of the project

Updated to build 208. I’ll let you know if I still see the issue.

Yes, I lose auto-indentation during this! Fingers crossed that that means you have some idea as to the cause.

Long-press didn’t seem to help last time, but I’ll try to use it if I see the problem again today.

Updated to 208, and still having the problem. Long-press save seems to ‘save’ my changes in the editor, but they do not get applied - that is, what I see in the editor is not the code that gets run. I will recognize the program behavior as something from a previous state of my code. If I close my project and reopen, sure enough, it shows the older version of my code. Auto-indent still gets lost.

How often would you say it happens? Does it happen from when you first open the project?

@brianolive What device are you running on. How many tabs and how much code in each tab. Is the code within Codea or in Files or somewhere. I’m trying to cause your problem on my iPad but I’m not having any luck.

It was happening very consistently this morning. I don’t have many changes to make right now (on the bright side I am happy that my Kanji learning project is coming together), so I’m not sure if it is acting up right now.

This is on build 208, iPad Pro 12.9 - the older one. 5 tabs, code actually is only around 500 lines total. One large Data.plist file (~7mb). Project is in the Codea directory. I am using the project zipping feature to get my changes over to Working Copy. I’ve deleted the project and copied it back in from Working Copy (all from within the Files app).

If I exit my project, and then reopen it, I am safe to make one set of changes and then run my project. If I return to the editor after running the code, then I’ve become leery of making any important changes. I usually have to exit out of the project again, and come back in.

OS: 13.3.1

@brianolive You’re on a 12.9” iPad Pro 1. Your code is in the Codea directory. You have 5 tabs with a total of about 500 lines of code. You make changes and run the code. Sometimes your changes work and sometimes it doesn’t. When it doesn’t and you edit the code, your changes are gone. I have a 12.9” iPad Pro 1 and I can create a project with 5 tabs and put about 100 lines of code in each tab and try things. Are you always doing the Save and Run option. If so are you having the problem when doing it. So is everything I say above about right.

I have tried using and not using the long-press save. I will also say this: I have gone for weeks now with only occasional programming in Codea, with no issues. Yesterday I put in a few hours in Codea, with the first 1.5h also having no issue. It was only towards the end, that I started to see the issue manifest. So, yes, you are correct in all of the above, but I’ve also done all of that with no issues. It is also the same behavior that I saw a few months ago, and then I had some longer projects, smaller projects, projects stored outside of Codea…so many variables. I appreciate you looking into it, but I am just not sure how to reproduce the issue with consistency. @Simeon mentioned the auto-indent not working when this happens, and that is true, so I would look there.

@brianolive I set up a project on my iPad Pro with 5 tabs and about 100 lines of code per tab. I haven’t been able to cause any problems changing some code. Of course my program doesn’t really do anything so that might be a reason. How much memory does your iPad have and how much is being used. It might be that when you run your code, something in Codea isn’t working right. Then when you make changes they’re not being saved like they should. It could also be the constant edit, run, edit, run, cycle might be causing something in the editor to malfunction. When I was trying things, I closed a project and tapped another project, but the one I tapped didn’t open, but some other one did. That was reported in another version.