Formatting issue in Rider

Answered

Hey everyone. I've recently installed Rider to properly learn C# and since I already use pretty much only Jetbrains products for everything else, I went with Rider instead of Visual Studio for this.

However, I'm having an issue that I can't figure out. Thing is, I am very used to putting my opening braces on the same line as classes, functions, etc. I am aware that the default for C# is putting them in a new line but, still, I'd like to keep my standard.

I've configured the formater in Editor → Code Style → C# → Braces Layout to use K&R style and even created a .editorconfig and, in fact, it formats correctly, however, whenever I press Enter between 2 braces it briefly but the opening brace in a new line and only then puts it on the correct place. 

I know that, in theory, it works, but this is somewhat annoying and it really seems something's fighting against some other thing and doesn't feel right at all. Does anyone know what could be the source of this and how can I change it?

 

Upload ID of that happening: 2026_05_21_VJCrNQutLfckp1e3LBdnPV

PS: Also, I've put IntelliJ in the topic as there isn't a Rider topic?

0
8 comments

xlysander12pt Could you please have a check if the symptom is caused by the confilct Live Template settings

It looks like you triggered the if live template then linter applys code format settings after that.

 

0

Hey Tao Sun, I've tried disabling the “Reformat” option and even editing the template to have the braces on the correct spot, but, even then, it didn't work. Also tried to change the option under “Use in” to “Generation” but still with no luck.

Funny thing, if I just write if and then try to use the template directly, it places the braces on the right spot without any “conflicts”.

 

0

xlysander12pt In the Settings | Editor | General | Typing Assistance, turn off auto-format on typing related settings, see if it helps to eliminate the flicker.

0

Tao Sun I've disabled “Auto-format on semicolon”, “Auto-format on closing brace”, “Auto-format on Paste → None”, “Smart indent on enter” and the problem persists.
Here are the settings as of now:

 

0

xlysander12pt If there is no other formatter provider, and code style settings under File | Settings | Editor | Code Style | C# have been configured matching with the K&R style (some directives like if may have particular configs there), you can export Layer-based Settings (in Settings | Manage Layers) and upload it here. I will have a check to see if it's reproducible.

A simple solution that can reproduce your issue would be helpful.

Share your Upload ID so that I can find it.

0

Hey there Tao Sun. I've uploaded both the machine layer and the solution layer settings. These can be found here: 2026_05_27_7XAtq4oLdZpzCZAsDQbfRb 

Thank you for your help!

0

xlysander12pt I filed a new YouTrack issue to developer team for further troubleshooting on the problem.

RIDER-139602 Code formatting settings (K&R and BSD style) conflict caused the input cursor to blink

Please feel free to star the issue to receive issue updates. If you have any other related findings, please feel free to update it on the ticket.

0

What you're seeing is usually caused by two different formatting features running at different times: The smart Enter/typing handler inserts the braces using the default C# convention (opening brace on the next line). Immediately afterward, Rider's formatter (or EditorConfig settings) reformats the code according to your configured K&R style, moving the brace back to the same line. Since the final formatting is correct, this is likely not a Code Style configuration issue but rather a behavior of the typing assistance. A few things to check: Make sure Editor → Code Style → C# → Braces Layout is configured for K&R. Verify that your .editorconfig isn't being overridden by another .editorconfig higher up the directory tree. Check whether Settings → Editor → General → Smart Keys or any third-party Rider plugins are affecting brace insertion. If you're using ReSharper settings imported from another IDE, verify they aren't overriding the Rider code style. If the behavior persists even in a new project with all plugins disabled, it may be a Rider issue rather than a configuration problem. In that case, the upload ID (2026_05_21_VJCrNQutLfckp1e3LBdnPV) should help the JetBrains team inspect the logs and determine whether the typing handler can be improved to avoid the brief "brace jump." One question: Which Rider version and operating system are you using? Also, does this happen only when pressing Enter between braces, or also when using code completion (e.g., typing class, if, or foreach and letting Rider generate the braces)? Those details can help narrow down whether it's a formatter issue or a typing-assistance issue.

0

Please sign in to leave a comment.