Line wrap indentation
Answered
Hello!
Is it possible to change the default indentation for long line wrap?
This is how it is:
This is how I want it to be:
Please sign in to leave a comment.
Hello Aleksander Woznica!
Try to play with settings in `File | Settings | Editor | Code Style | C# => Tabs, Indents and alignments. Seems like disabling `Align Multiline constructions => Other expressions` could help.
I have a similar issue as Aleksander. E.g. when I put method parameters on a new line (manual hard wrap), the caret goes to the same indentation as the method, but I want it to be indented by one level. Basically always indent +1 level on line breaks within a statement. I played around with the C# code style settings, but I can't find the setting.
What it does:
What I want:
Hello Lucas,
Could you elaborate on “manual hard wrap”? do you mean pressing “enter” in the line? I've tested the following scenarios in the latest Rider (2025.1):
Either way works and add indent as expected.
I recommend you review existing settings, and .editorconfig if any. One setting I find that can reproduce the issue is “Indent method declarations' parenthesis” under Settings | Editor | Code Style | C#:
Please check if this setting is set correctly for your case. If still no clue, please raise a ticket, and attach Rider settings:
File | Settings | "Manage Layers" button at the bottom => “Export to File”
in the context menu for each layer. Please also include .editorconfig file if it exists. I will try to reproduce the behaviour once again with your settings, and hopefully, we can pin down the root cause of the issue.Regards,
Tom
Hello Tom,
Yes, I mean pressing enter anywhere inside a code statement, where the beginning of the new line should be indented plus one level. In my case, this is present everywhere, i.e. Rider never makes that indentation one level up, it always places the caret on the same indentation level as the previous line. I can see it for a fraction of a second doing it correctly, but then it immediately “unindents” the caret. It looks to me like two settings are “fighting” and the wrong one always wins.
I am so used to being able to place the caret anywhere in existing code, press enter, and the new line is indented one level up from the previous line. It works in my Visual Studio with the latest ReSharper tools installed, but not in Rider.
The settings you suggested are set correctly.
I did open a ticket and supplied the requested settings files (see RIDER-124528).
BR