Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Codea 3.3.2 (275) (276)

dave1707dave1707 Mod
edited May 4 in Beta Posts: 9,441

Pasting code with an else in it correctly indents the else statement.

Typing else and pressing return de-indents the else statement.

Find works for a single character. Haven’t tried it on every single character yet.


  • SimeonSimeon Admin Mod
    Posts: 5,705

    Thanks for the quick report @dave1707 !

  • Posts: 2,364

    @dave1707 @Simeon - hi guys, running 275 and just trying out @UberGoober 's latest enhanced explosion. Worked fine but - I was looking for the explosion shader and tapped on the explosion asset link in the code - line:

    pt.material = craft.material(asset.Explosion)

    but couldn't find it in any of the folders displayed. So I assumed it must be held in the "dave1707 Explosion Demo.codea" file which you can't see with the asset browser. So I looked for it using the Files app and found the file mentioned here. On tapping it it started opening in Codea then Codea crashed. I repeated this both with and without Codea present in memory and it crashed inconsistently. Once it ran then I tried to run it from the Codea folder with it loaded in memory and it crashed. Will ensure I send a formal crash report.

    Apart from the crash, why can't we see the shader in the assets list?

  • Posts: 2,364

    @dave1707 - started to fill another crash report out but tried to scroll off and retest but report window disappeared. Here is what happened:

    I had @UberGoobers carousel 1.5 loaded but he reported updating it in same zip link. So downloaded and installed. All seemed OK but when trying to re-install I took my finger off too soon so couldn’t share zip file to Codea. No probs as the file was unzipped into the Filer folder. So touched that to get sharing up and shared it with Codea, opened into Codea which then crashed. Seems to be a related problem.

  • edited April 30 Posts: 2,364

    @Simeon - I know you won't be concerned about this but thought that I'd register it anyway. I was using Air Code and my Mac and was transferring tabs from one project to another. I had Main, Utils and StringThing tabs and wanted to add a fourth which I called FileManager - the latter was not visible on my Mac. So I logged out re-logged in and then tried again. Still no joy so I changed the order of the tabs and changed the FileManager name to FileBits thinking it may have clashed with something. Still no joy. So I logged out and duplicated the project file on my iPad then re-logged back in. The initial project still had three tabs the duplicate had 4 ?

  • Posts: 1,292

    @Bri_G the odd thing is that in my project I do see the shader in my asset list.

  • Posts: 1,292

    Is anyone else experiencing files randomly reverting to old versions?

    I used to be unsure whether or not I was imagining things, but since getting Working Copy I have proof positive, because I can see old versions of my projects.

    It's rare, but I'd say about once a week I open a project and think, hey, wait a second, didn't I do x yesterday? And I go and check Working Copy and sure enough I did, but for some reason Codea threw it out.

    Anyone else seeing this?

  • Posts: 1,090

    codea and working copy seem to work by sending telegrams to each other. in particular, i find that reverts often fail to update back to codea. i usually exit the project before reverting. i imagine the same could happen on a checkout of an earlier version. i don't think i've seen changes in WC that got lost from Codea, but i could be wrong.

  • Posts: 2,364

    @Simeon - getting some funnies in 275, variables declared in setup eg str = “” throws an error up when trying to concatenation later.

  • dave1707dave1707 Mod
    Posts: 9,441

    @Bri_G Does that also happen in version 276.

  • edited May 4 Posts: 2,364

    @Simeon - my bad, that was version 276. Lost track of version changes - you’ve been busy.

  • SimeonSimeon Admin Mod
    Posts: 5,705

    @Bri_G do you have a code sample that triggers the error?

  • Posts: 1,090

    I'm in 269. I've just seen something similar to @UberGoober 's issue, where my program tab and Codea were out of sync. I had added code to the tab, and it wasn't running (it was a test, so I could see that it hadn't even tried to run). The code was in the tab. I did the Save Project and Run thing and the code, still in the tab, still didn't run.

    I exited the project and went back ... and the code that had been in the tab was all gone.

    The project, like his, was under Working Copy, so it may be involved. I'll send a note to the Working Copy author to see if he has any ideas. My fix, in case it is Working Copy, will be to exit the project before I do my Working Copy hookup and initial commit.

  • Posts: 1,090

    I have a solid reproduction of the problem. Here's the note I sent to Anders:

    Hi Anders, and Simeon ( on Codea Forum)

    I'm seeing an odd new interaction between Codea and Working Copy. I'm sending the same report to both of you.


    When an open Codea project is synched to a new Working Copy repo, further changes to the Codea tabs have no effect until the project is exited. New code shows in the Codea editor, but is clearly not compiled and executed. Working Copy does not show the changes either. If you exit the project, all the changes are lost.

    The bug seems to be sensitive to the number of tabs you have. The example below is with just a Main tab and it seems to be able to be reproduced. I've seen it with two tabs but can't reliably reproduce.


    Create a small new app in Codea. Little more than a hello world.

    Init a Working Copy repo for it; share; attach the project. Initial commit. Repo looks good.

    Make small change to the Codea program, to print "and felicitations". Does not print.

    Code is visible in Codea tab.

    Codea: Save Project and Run, to be sure code is flushed.

    New print still does not come out. Code still visible in the tab

    Check Working Copy to see what it sees.

    It sees no changes, Commit does not highlight.

    Close Codea project.

    Reopen Codea project. Tab is back to initial commit state, new code not shown. In other words, now shows what was running, missing out the "and felicitations" line.

    Put the change back in.

    It runs as expected.

    Working Copy now shows the change.

    That seems to happen every time.

    Without Working Copy

    OK, now I'm going to do the same exercise without Working Copy.

    Both the new lines immediately print. Codea is not confused.

    With Working Copy and Codea Project closed

    Start again, same thing, except that this time we exit the project and THEN hook it into Working Copy.

    Open the project, make a change, and the change takes.

    Working Copy correctly shows the new code for commit.


    It appears that if we init and connect a Working Copy repo with a Codea project open, Codea can become confused about what files it should be looking at, and does not see changes in its own tabs, which neither run nor ever show up in Working Copy.

    Usually, when things are working right, Working Copy sees changes in Codea files even before Codea has run them or saved them. (I do not know how this magic occurs, but I see it.)

    But it appears that if you don't do your initial hookup with Codea's project closed, something goes awry.

    I'm available to try more things, and hope this is at least somewhat helpful.

  • edited May 4 Posts: 2,364

    @Simeon - just ignore my previous post, in stripping down the code to get a small demo I found a ‘beginners’ error - I had placed a variable definition after the function call using it in setup() - dooohhh (its an age thing !!!!).

  • SimeonSimeon Admin Mod
    Posts: 5,705

    @RonJeffries I'll take some time to reproduce your working set up. I'm noticing crash reports which involve trying to open a completely "blank" project (that is, a .codea/ folder with no files in it)

    Anders is pretty knowledgable about iOS file system interactions, so my feeling is that Codea is doing something bad here and I'll need to get to the bottom of it

  • Posts: 1,090

    i suspect so as well. the codea / working copy connection is weird at best. good luck!

  • Posts: 1,090

    I got the note shown below from Anders. After rebooting to look for Working Copy in Files, I could not reproduce the error.

    Hi Anders,

    On May 4, 2021, at 3:10 PM, Anders Borum wrote:

    Could you check if Working Copy exists in the Files app and is functional here?

    Sometimes when Working Copy is updated (as it was today) the Files app becomes confused and this also influences the ability for apps to share directories and files while editing in-place.

    The solution if this is the Files app is to reboot your device.

    I may have already rebooted yesterday, but today I did not find Working Copy in the Files app, neither under On My iPad nor in iCloud Drive. I rebooted (again?) and it is still in neither of those places.

    I tried to reproduce the problem, and I was unable to do so, using the procedure I wrote up yesterday. So perhaps it has healed. I'll pass a copy of this note on to Simeon.


    Ron Jeffries
    Speed is ppoor subsittute fo accurancy -- Fortune Cookie

  • SimeonSimeon Admin Mod
    Posts: 5,705

    @RonJeffries interesting, thanks for following up. I'll try your steps regardless as I'm sure we can find some things to fix on the Codea side.

  • Posts: 1,292

    I’m seeing this problem in projects I have no repository for. Working Copy shouldn’t know anything about them at all.

  • Posts: 1,090

    OK, good input. Can you find a way to reliably reproduce the problem?

  • Posts: 172

    i wish we had some idea of when Codea 4 is coming, it’s already May :o

  • Posts: 1,292

    I wish I could reproduce it but I see no pattern to it. My hunch was that it was working copy related too, for all I know it still is.

  • Posts: 1,292

    Can’t say what’s doing it but I just saw it again.

    I was in split screen with Procreate on the left. I was tracking an iteration using print statements, and it kept going to 600 when it should have stopped at 540. I played the project, then checked the iteration to make sure its limit was 540, and played the project and checked the iteration, etc etc, I don’t know how many times, and the print statement always came out to be 600. So I thought maybe it was this bug and I exited the project. Sure enough when I opened it again the iteration code had the limit back at 600. My alteration to 540 had been thrown out. Also before I exited the project I did a long press on the play button in the upper right, so I got the “save & run” window first.

    Have no idea what’s causing it but that’s the most complete description of what I was doing that I can think of.

  • Posts: 1,292

    This time I changed a sprite from 15,15 to 22,22. I ran the project and it looked good. Then I closed the project and ran a different project. When I went back to the first project, it was back to 15,15.

  • dave1707dave1707 Mod
    Posts: 9,441

    @Simeon Ran into a major problem. I don’t know if it’s specific to the latest release or any release. I was doing a saveImage to the Dropbox folder. I was using parameter.text for the file name and it’s possible nothing was entered in the text field when I did the saveImage since I was just updating the code. Anyways, the Dropbox folder then wanted to be known as Dropbox_assets. Every project that referred to Dropbox wanted Dropbox_assets to clear the error. Since this was wrong and there wasn’t anything I could do about it, I had to delete Codea, reload it and restore all of my projects. Everything is back to normal, but that could be really bad for anyone without backups.

    If I keyed asset.documents. then in the autocomplete list it showed Dropbox_ assets instead of just Dropbox.

  • Posts: 2,364
    @dave1707 - that is precisely what I found with .obj and .MTL files on Dropbox. I had to address them as object_obj to get them to load, even though the file was object.obj.
  • SimeonSimeon Admin Mod
    Posts: 5,705

    @dave1707 I think what happened there was that you saved a file called "Dropbox.something" (or "Dropbox") into your Documents (asset.documents) folder. Then Codea has no way to know which "Dropbox" you want to refer to, and needs to disambiguate by adding the full extension (Dropbox_assets)

  • edited May 12 Posts: 1,292

    OK, same bug but this is a weird one.

    I’ve got a project where a tab copies itself, changes the end of itself, and then overwrites itself.

    I don’t think that process is the problem, because I’ve run the project many many many times without seeing this bug. Plus, as noted above, I have seen the same bug in other projects where I don’t do this.

    I wrote a fairly large function on the tab. I added a Parameter instruction to the top of the tab for a button which would call that function. I ran the project.

    The parameter button was there. I stopped the project. Then I deleted a large block of comments. I ran the project again.

    When I exited the project, I noticed that the large block of comments had been restored. I deleted the comments again. I ran the project again.

    I noticed that the new parameter button was missing. I stopped the project, and I saw that the code I had just re-deleted was still deleted, but the parameter instruction was still gone.

    This project is not part of a Working Copy repository.

  • edited May 13 Posts: 2,364
    @Simeon - had a funny here. Project with three tabs, main, utils and docs. The docs were routines which I had copied from other projects but didn't want in the current project(just for reference) so it was commented out. The project saved data to a new fourth tab but again I didn't want the output adding to the code so writing to it was written together with the commenting pair.

    Problem, when run the first time the fourth tab was not created. The second time it was. Sometimes, inconsistently, both third and fourth tabs were not commented out despite the commenting characters being present in both.

    Whilst on this topic - when writing to a named tab - if it exists would it be overwritten or written with the same name with the addition of an index. Say data then data-1, data-2 etc.

    Edit: forgot - or would it just be ignored and an error posted. Is there a way to check 'if Exists(file/Tab)' ?
  • Posts: 2,364

    @Simeon - assuming we still have the same storage options in future versions of Codea, could I request an option from the project list page.:

    When you press a project icon to get the menu for that project(ie delete, export etc) could you add a move option so that you can transfer it to a Collection. That saves stepping out of Codea and using the Files app to move it within the Codea root folder.

  • SimeonSimeon Admin Mod
    Posts: 5,705

    @Bri_G the plan is to move entirely to the Document Browser and remove the custom project browser screen, so that the app will look like a standard file picker when opened

  • Posts: 2,364
    @Simeon - thanks for the update, looking forward to 4.
  • Posts: 1,292
    Is it some new human interface guideline thing that Apple is pushing that every app should look like the file browser now? I’m seeing this in other apps too, and not a fan. I get confused about what app I am in. If you’re going to do that, please put some super obvious indicator that I am using Codea on the screen.
  • SimeonSimeon Admin Mod
    Posts: 5,705

    @UberGoober that's my biggest hesitation too, but I just can't think of a good way to support all the varied features of the file system without spending a lot of time trying to implement it myself. At the moment Codea can be used with the though, as in, you can tap on Codea projects in other locations to edit them directly in Codea. Perhaps that's enough?

  • edited May 18 Posts: 1,292
    @Simeon I once did QA at a company that basically wasted 40% of its development time re-implementing a file system inside of Unity, which for crying out loud already has a robust file system, so I’m very familiar with the quagmire such things can become.

    Personally I’d recommend possibly re-reviewing the things that people are most commonly asking for. That might bring the goalposts closer, and it may become evident that the present systems can be modified to address those specific needs much more easily than it seems.

    For example, just speaking for myself, I’d be well satisfied if the projects screen didn’t have any major changes other than gaining a somewhat-iOS-like ability to group projects icons into sub-folders.

    And as for tabs, the sidebar is already set up to serve multiple purposes, and if one of them was simply a vertical list of tabs, it would improve the ability to navigate a large project a gazillion percent. Plus it seems to me that you already have the code for a vertical list of tabs, and it even already supports drag-and-drop re-ordering of them as well as color-coding of the tab names to spotlight tabs that have errors. What you already have, just deployed a little more conveniently, could do quite a lot.

    Of course it would be way super cool to have a sidebar like Xcode or Visual Studio have, with folders and file extensions and direct asset management and all such stuff, but honestly it seems to me you’d give us most if not all of that functionality if you just allowed us to browse Codea projects, right from the iOS file browser, as if they were folders. I know you’re planning to do that already inside Codea, but it seems to me you’re taking it too far. What I’m suggesting is retaining what it looks and feels like to be *in* Codea (with maybe minor enhancements guided by what’s been requested the most) and mainly just giving us more ability to do stuff *outside* it.
  • SimeonSimeon Admin Mod
    Posts: 5,705

    @UberGoober at the moment you can organise projects into folders, but you need to do it in the Files app. Then you can drag projects in and they will appear in a collapsable section within the Codea project browser

    As for browsing the insides of projects, I wish the Files app on iOS allowed you to inspect bundles (folders with an extension). On macOS you can right click and choose "Show package contents". So the solution I've been thinking of for this is to allow people to pick a folder to use as a Codea project

    As for the rest, that is good feedback and I'll keep it in mind as I work on this aspect of Codea

  • Posts: 1,292

    @Simeon I didn’t know about using Files to group projects, that’s really cool. Is that discoverable in the app somehow?

  • edited June 19 Posts: 30

    Sorry to confess, but the new autocomplete is driving me absolutely crazy. The problem is probably that unlike most hobby coders, I include a lot of comments. Whenever I’m writing comments, Codea can have a giant list of autocomplete objects, and since both TAB and RETURN do the autocomplete, if I’m tabbing to format things or at the end of a line and hitting RETURN, it autocompletes something.

    Unfortunately, the same thing can happen in code, when the end of a line is a variable name that also matches the beginning of something that will autocomplete, or if I try to insert a tab (I use tabs a lot to properly space and align my code, to make it more readable).

    I don’t know how to “fix” this, or even if it should be fixed; maybe for most Codea users, the autocomplete is the better and more common behavior. It would be nice if it could at least be turned off while in comments (either within a comment block —[[ ]] or while in the portion of a line after the comment marker —). The same goes for some of the auto formatting within comment blocks, like automatically adding “end” statements after it sees the word “function” or “then”.

    But it is driving me nuts. I’m spending a lot of time training myself to look at the autocomplete bar to make sure it won’t mess me up, and not just hit TAB or RETURN without thinking twice. Maybe… would it be possible to italicize the text of the word that will be autocompleted when the autocomplete has options, so there is visual feedback on the screen, where the coder is looking, that autocomplete has become “active”? And can some key be assigned to cancel autocomplete (but I’m at a loss as to which key; maybe tapping the shift or option or command modifier key?)? I know I can hit the X in the autocomplete bar, but again, that requires that I shift my attention from what I’m typing to the bottom of the screen, and take my hands off the keyboard to touch the screen (I use an attached keyboard on my iPad, so that may also be part of my problem).

    Right now, to get out of it I have to hit a space or the up or down arrow, since the left and right arrows change the autocomplete option, and tab and return activate it.

    Or maybe just provide an option in preferences to turn autocomplete off. There is something there to do with autocomplete, but I don’t understand from the language or from experimenting how it actually impacts anything.

  • Posts: 2,364
    @blacatena - which version of Codea are you running in? I thought one of he recent betas had added the option to change the behaviour of the autocomplete. The latest beta is 280.
  • Posts: 30
    1. As I said, I’ve tried turning the option for “exact matches” for autocomplete on and off, and it seems to make no difference in the app behavior… type a sentence in a comment that ends with “the”, hit RETURN to go to the next line, and it replaces it with “then”, regardless of how the autocomplete preference is set.
  • SimeonSimeon Admin Mod
    Posts: 5,705

    @blacatena sorry about the frustrations with the new behaviour. The setting you refer to ("exact matches") applies to when autocomplete is shown.

    For example, stroke and strokeWidth are valid completions. If you type stroke the default behaviour is to not show any more completions. If you turn on "Results for exact matches" then typing stroke will continue to show strokeWidth as a possible match in the autocomplete bar

    We should definitely not show autocompletions within a multi-line comment block! That is a bug, thank you for reporting it. Autocomplete should not be showing for single line comments (after --)

    As to the problem more generally, I think we should include a keyboard shortcut to dismiss autocomplete. I think it should be the backtick key (`) as this is close to where "escape" typically lies. We should also support Cmd+Period, which is iPad's default mapping for escape

Sign In or Register to comment.