How to make keyboard shortcut comment put slashes at beginning of text not line?

I swear PHPStorm by default put the slashes at the beginning of the text, but now it puts it at the beginning of the line, which can look bad and possibly throw me off when I'm scanning or searching code. Here's the keymap shortcut I use:

Now, I'm not seeing how to change whether the slashes start at the beginning of the line or the beginning of the text... I found this though I see no toggle for that here:

Does this toggle exist and where is it?

6 comments
Comment actions Permalink

Try searching for Line comment at first column option - it should be somewhere in your language code style preferences, usually on Code Generation tab. For example, for javascript it's in Preferences | Editor | Code Style | JavaScript | Code Generation, for HTML - Preferences | Editor | Code Style | HTML | Code Generation, for PHP - Preferences | Editor | Code Style | PHP | Code Generation

Unckecking it should solve your issue

4
Comment actions Permalink

Thank you! I found it.

It works as expected!

0
Comment actions Permalink

I noticed the setting didn't carry over to another project, then I had trouble finding it again because it doesn't highlight when I search for comment (like PHPDoc Align tag comments does).

Why doesn't the Code Generation option highlight for comment when two options there contain the word?

0
Comment actions Permalink

What version of PhpStorm do you have installed?

I just checked this option on my installation and, in fact, it is highlighted:

A short remark though -- you may need to click PHP setting section again while changing tabs as extra clicks will remove the highlight.

0
Comment actions Permalink

I found this for PHP but not for YAML... there's no Code Generation tab. Editing code there makes some weird behavior when the # character starts at the beginning of the line instead of the text. 

Is this somewhere else for YAML? I don't need to generate code, I just want to have Cmd+/ add the # character to the beginning of the text's indent, not the beginning of the line. I honestly am not sure why this option would be in Code Generation anyway, as a line comment signifier isn't code, the whole line becomes a comment (not parseable code).

0
Comment actions Permalink

Can't see anything similar for YAML. You can submit a feature request for this to our tracker at https://youtrack.jetbrains.com/newIssue

0

Please sign in to leave a comment.