Pinegrow shouldn't add, but strip trailing whitespace when 'Auto-format HTML' is on

Hello Administrator,

I use Pinegrow for Windows in-pair with Atom for editing, and GitHub for version tracking. I’ve, noticed, that Pinegrow adds a lot of random trailing whitespace on save to end of lines, when ‘Auto-format HTML’ is on – both when saving pages one-by-one, or at once.

Since leaving trailing whitespace in files is bad practice, it’d be nice if Pinegrow didn’t add, but instead strip trailing whitespace on save. As well, Atom comes with a package called ‘whitespace’ on by default, that does strip whitespace on save. This means, when using Pinegrow in-pair with Atom’s default settings, Pinegrow’s added whitespaces will be stripped by Atom – and vice-versa, creating and endless fight between the two, and a complete mess in version tracking.

A workaround right now is disabling Atom’s ‘whitespace’ package, not to strip trailing whitespace on save at all. However, since it results in cleaner code, it’d be useful to instead make Pinegrow capable of not adding, but stripping whitespace on save.

Kind regards,

Márton Lente

1 Like

the sage advice seems to be to turn “auto-format” off

it seems to cause more problems than it solves, and as you noted, does not play well with external editors (either atom or VS).

@droiggoo thanks for your idea. Though Pinegrow’s ‘Auto-format HTML’ is extremely useful in my case, Pinegrow being the software I spend the most time with when doing bespoke development.

In my experience the auto formatting feature works really well, the above being the only, yet still major issue – especially for those using version tracking in their workflow. Would be nice to get resolved soon!

curious, i have it off and have not noticed anything wierd going on.

but then i’m also using VS and have it set to auto save so it stays in sync with PG.

the only odd bit i’ve noticed is sometimes when i’ve added markup from PG the code in VS will not have a line break after an item, and i will need to add that manually in VG so everything looks right at that indenture.

haven’t yet explored the relm of ascii art in my code, but my understanding is if you want to keep it looking they way you left it, the “Auto-format” needs to be off, or it will mess with your “artwork”.

Hello,

Are there maybe any plans to solve this issue @matjaz ? The thread is two years old, and Pinegrow still fights with Atom’s default ‘whitespace’ package, messing up version tracking with extra trailing whitespace characters (depending on if the according file was saved in Atom, or Pinegrow last time). It’d be extremely useful, since I think this is the only weakness of Pinegrow’s already excellent auto formatting feature.

Of course disabling Atom’s ‘whitespace’ package solve this, but that’s a handy feature, that makes code cleaner.

Thanks,
Márton Lente