Line Limit Restrictions on Lua Files or bug?

Good morning!

I had a question involving the number of lines allowed in a single Lua file/tab. I have been recently converting CSV files using Python in to Lua files to get around the lack of file system support in Codea. I have one CSV that simply will not import in its entirety. When added in via iExplorer, I have no problem getting Codea to recognize the file itself, however the file appears to be empty and no line numbers are displayed. I’m pretty sure it doesn’t have to do with size, as I have a few other converted CSV->Lua files that are about 100K larger in bytes, but about half the number of lines. The one I am trying to import has around 15,232 lines within it.

I was wondering if this was a bug or maybe just a restriction placed for performance. I know having 15,232 lines of code in a single tab is a bit unusual, but I know Codea can handle the handling of large scales of data without too much of an issue. Thanks guys!

Wow, you really put it through it’s paces! :slight_smile: When I put about 1400 lines in a tab, I find the editor slows down a bit, and can sometimes crash (but not lately). When there are a lot of numbers used, I see them highlighted for the number spinny thing, which noticeably slows down scrolling. Multiply this effect by 10 and I can imagine the editor freaking out…

That is an unusually long file. I’m surprised it works at those sizes.

Is there perhaps a better way to do this — perhaps for your project you should edit the LuaSandbox.lua file to un-sandbox the IO functions. That way you could read them using standard IO and not have them be part of the editor.

Alternatively you could keep them online and access them over HTTP.

Yeah, I might have to the un-sandboxing. I have tried doing them over HTTP, but the same issue happens. It detects the value as a string after retrieval but the value is empty.

I know that vanilla lua can handle massive files (a lot larger than that, tens or even hundreds of megabytes) without problems. If there is a problem with this, it would somehow be related to how codea uses lua.

I appears to be an issue with how many displayed lines, not how much data. I have several other files that are larger and don’t have an issue. However, the moment I tried to use the larger by line numbers one, everything in that tab disappears.