-
Notifications
You must be signed in to change notification settings - Fork 185
emacs mode indendation is wrong for string constants with backslashes #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think the current indentation is correct. I wouldn't expect indentation to ever change the inside of a string literal. (None of the other programming modes that I tried out do it either.) The |
I agree that I'd be surprised if a string literal was indented on the second line. I can also confirm I see the |
I disagree. Most languages don't have backslashes at the end of line which skip all following whitespace. The express purpose of this syntax is to allow you to indent string constants nicely! |
If you look through rustc you'll see where it's useful and also that indenting single-line strings that are spread across multiple lines so that they line up is what we typically do (although now that emacs doesn't handle it correctly, many of them have gotten messed up over time). |
Well I'll be--I didn't know that. Sure enough, this: fn main() {
println!("foo\
bar");
} prints But now I understand the original issue here. |
Certainly not how I expected to learn about this feature, either! |
Wednesday Apr 16, 2014 at 22:20 GMT
For earlier discussion, see rust-lang/rust#13568
This issue was labelled with: A-tools in the Rust repository
the following code indents oddly:
I expect:
The text was updated successfully, but these errors were encountered: