+3
Under review

Trim trailing whitespace

jsageryd 5 years ago updated 5 years ago 3
I would like an option to trim trailing whitespace. It would be nice if this could trigger automatically at some point. I am used to Sublime and vim trimming on save; perhaps a keyboard shortcut could work.
Under review
I wouldn't do it automatically, since for example Markdown uses two trailing space characters in a line to signal that the user wants to have a line break (<br>) after this line.

I think it would also be necessary to have an option to show space characters (and other invisibles) similar to how tab characters can already be shown.
Yes, good point about markdown. It does not make sense there.

A shortcut key to trim trailing whitespace on the whole file or a selection would be a very nice feature, though. I'd be using it all the time.
About showing spaces; I am using a plugin for Sublime (cannot recall its name at the moment and I am far away from a computer) that highlights trailing whitespace making it rather obvious where the mistake is.

It also highlights space before tab, which should never occur (the other way round is fine, though, for alignment).