r/WarOnTheSea • • 6d ago

Split Group

Post image

Okay, syntax highlighting is complicated. But what if we could at least split the file into lines? It'd be easier to read. Maybe edit something. And then collapse it back.

Find:

(?:(,)(?="[a-z][a-z\d_]+":)|(,)(?="\{\\"mobileName)|(,)(?="\{\\"locationID\\"))|(\n)

and Replace All

\1\2\3\4\n\4

To Merge back, find:

(\n)\n\n|(\n)

and Replace All

\1
4 Upvotes

3 comments sorted by

1

u/Striker01921 4d ago

Because the version on the left is what happens when you compile code, the compiler removes all the white space, comments etc that is not needed to run the code.

1

u/Ivvango 3d ago

I wanted config and savegame files to be easy to read. And edit if necessary. Unfortunately, Sublime Text doesn't allow to add phantom line breaks to the displayed text.

2

u/Kraznova 6d ago

Why are you continuing to post game code when you got banned from the official forums for doing so?