You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nixfmt intentionally throws the choice between literal tab characters and
escape codes away because it ensures semantically identical strings get
formatted the same way. It uses heuristics in order to determine how they
should be printed. In this case, I think an acceptable thing to do is to
format only indentation as tabs and anything in the middle or end of a line
as escape codes. I will try this out sometime soon.
Yeah, I think normalizing the formatting of tabs is a good idea. I don't have a very strong opinion in this instance since I so rarely encounter tabs in Nix strings.
Instead of different behavior depending on where the tab is in the string I think it would be best to have a very simple rule saying that \t is always expanded (i.e. to keep the existing behavior) or tabs are always contracted to \t. I'm slightly in favor of always contracting to \t for legibility reasons but I would not protest keeping the existing behavor.
Description
The
\t
form of tab characters in strings are expanded to a literal tab character. The result could be confused for space characters.Small example input
Expected output
Actual output
The text was updated successfully, but these errors were encountered: