The comment slash // is indented too left (Rider)
Asked Answered
G

2

6

I'm using Rider, and when I comment out a line using the keymap "Comment/uncomment with Line Comment", the slash // is indented too far left and not where the actual word was appearing. Perhaps a picture can illustrate it better.enter image description here

I'd like the slash to be where the line started originally, like when you use vscode or sublimetext:

enter image description here

Sorry for the weird topic, but it has been nagging me for quite a while now and can't stop thinking about it while typing (:D). I couldn't find the setting that would change this.

Garrote answered 10/1, 2019 at 11:36 Comment(0)
A
7

Check here for how to change it.
https://www.jetbrains.com/help/rider/Coding_Assistance__Comment_Uncomment_Code.html#commenting-and-uncommenting-with-line-comments

According to the Don't indent comments started at first column option, the comment will be added with or without the indent. You can configure this option for different languages separately, for example, for C# it is on the Editor | Code Style | C# | Tabs, Indents, Alignment page of JetBrains Rider settings Ctrl+Alt+S.

Amr answered 10/1, 2019 at 12:4 Comment(0)
S
5

Settings > Editor > Code Style > C# > Tabs, Indents, Alignment:

And toggle checkbox: Don't indent comments started at first column.

enter image description here

Sostenuto answered 16/2, 2019 at 17:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.