Block Uncomment Toggle Broken

My new favorite Studio hotkey CTRL + SHIFT + C is broken on this input:

Expected behavior is that with this block selected block comment toggle will uncomment this block.

Instead I get double comments.

It’s possible that on some inputs it is not obvious if the operation should be to comment or uncomment, which is maybe why Visual Studio has two different hotkeys instead of a toggle.

Interestingly, toggling CTRL + SHIFT + C over and over again on this input simply alternates between these two states. It does not create a continually ever-more-nested code block.

It appears that the toggle is adding additional comments because line 2 is not initially commented. Since the whole thing isn’t commented, it assumes you want more comments. Then, once everything selected has comments, pressing Ctrl+Shift+C works as expected.

You can set hotkeys for Comment Selection and Uncomment Selection by going into File->Advanced->Customize Shortcuts

1 Like

Do you think this is the ideal behavior?

But… line two is empty…

That’s correct. A bug for this has been added to our list already.

1 Like

It also breaks when Studio messes up my indenting.

So this input will double-comment.