Add \s as an alias for \x20

Sometimes you want indented long strings, such as in --help output:


But it doesn't work very well. So instead you need \x20:

         \x20   bar\
         \x20   baz"

This doesn't make me happy tho. So instead I'd like \s:

           \s   bar\
           \s   baz"

Bonus points is that it correctly aligns with the ", which gives it a vertical line on the left edge of the string.

I highly recommend the indoc crate for constructing literals like this instead of using the end-of-line \ behaviour.


Personally, I like the idea of "just" making backslash non-newline whitespace work in order to terminate backslash newline's whitespace-eating behavior.

But it's somewhat difficult to specify for very little gain, so it's very low priority. Especially since now things like indoc! can be written in userland for an arguably better dedent experience.


I'd rather have backslash-space than backslash-S.

is backslash-space available?

Why not try it yourself?

This is equivalent to

"SYNTAX    bar    baz"

But I believe what you want is


which can be written as

        \n    bar\
        \n    baz"
1 Like