japhib / pico8-ls

PICO-8 Language Server
MIT License
69 stars 8 forks source link

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

Open schoblaska opened 9 months ago

schoblaska commented 9 months ago

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 9 months ago

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

schoblaska commented 9 months ago

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