Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Example:

local averylongname = 10

With default ticked boxes (Comments, Compact, Functions, Other identifiers)

Try the updated version. I wasn't catering for spaces either side of the equals 🤦‍♂️

It’s working now! It doesn’t seem to work with many spaces though:

local averylongname4 = 100 becomes local averylongname4 = 100

Yes, its pretty hacky. I could easily fix this but due to pico-8's limited number of characters, it seems unlikely that anyone would double-space around symbols such as equals. The reason I missed the spacing the first time was because I've got into the habit (not my usual coding habit at all!) of not putting spaces before and after equals. I'll probably give it a bit of an overhaul the next big project I do and try and sort out stuff like this and also make it a bit easier to use. Thanks for identifying the issue though

OK I see, I sometimes put multiple spaces for data alignment (it takes more space but I write the code on the assumption I’ll minify it).

Currently I’m using a custom branch of luamin for my minifications, it’s really good with most normal Lua code. It uses actual parsing which allows it to spot invalid code. But the downside is that it doesn’t recognize the PICO-8 specific patterns like 1-line if() (and some binary operators despite being part of vanilla Lua) so it would error on most code actually written by PICO-8 devs… Requiring me to write fully expanded statements everywhere to avoid errors, then minify them (final result is still good! But I wonder if I couldn’t grasp a few characters here and there with a truly “PICO-8 aware” minifier.