Describe the bug
If I have an escaped newline (''\n) in a indented string, any whitespace after the escaped newline will be stripped that whitespace were part of the leading indentation of a line. This feels unintuitive to me, since I expect the indentation stripping to only be relevant for code formatting.
Steps To Reproduce
evaluate
result:
Expected behavior
I expect the space after the escaped newline to be preserved:
Metadata
nix-env (Nix) 2.34.7
Additional context
Having no leading indentation leads to no whitespace stripping after the newline, for example
evaluates to
as expected.
There's precedence for not fixing these types of bugs for backwards compatibility, but maybe there could be a note added to the manual? https://nix.dev/manual/nix/2.24/language/syntax#string-literal
Checklist
Add 👍 to issues you find important.
Describe the bug
If I have an escaped newline (''\n) in a indented string, any whitespace after the escaped newline will be stripped that whitespace were part of the leading indentation of a line. This feels unintuitive to me, since I expect the indentation stripping to only be relevant for code formatting.
Steps To Reproduce
evaluate
result:
Expected behavior
I expect the space after the escaped newline to be preserved:
Metadata
nix-env (Nix) 2.34.7
Additional context
Having no leading indentation leads to no whitespace stripping after the newline, for example
evaluates to
as expected.
There's precedence for not fixing these types of bugs for backwards compatibility, but maybe there could be a note added to the manual? https://nix.dev/manual/nix/2.24/language/syntax#string-literal
Checklist
Add 👍 to issues you find important.