japhib/pico8-ls

Formatting inserts a space above header comments that breaks pico-8 cart label

schoblaska opened this issue · 5 comments

When the top of my file looks like this:

pico-8 cartridge // http://www.pico-8.com
version 41
__lua__
-- sokotiles
-- by schoblaska

The cart label gets generated like this:

image

But if I have pico8-ls format the file, it inserts an empty line like this:

pico-8 cartridge // http://www.pico-8.com
version 41
__lua__

-- sokotiles
-- by schoblaska

and now the cart label only includes the first comment:

image
japhib commented

Does the formatter insert the space at the top of the file?

I believe so, yes. In my editor, the empty line is only inserted when the pic8-ls extension is enabled.

Faced the same issue. Simple workaround is just removing it and running > File: Save without Formatting before exporting the .p8.png. But would be nice with a patch.

Added #65 to try to resolve the issue

Released with 0.5.6 just now