Disable caret moving at comment hotkey

When i do line comment(ctrl+slash) - caret has moved to next line, it's make me mad.
Somehow possible to do exactly same, but without caret moving?

I sought such option in settings, but found nothing.
You cannot disable that, however you can define a macro.

1) Start with Edit | Macros | Start Macro Recording
2) Press "Ctrl" + "/" to comment out current line
3) Press "Up" to move caret to that line again
4) End with Edit | Macros | Stop Macro Recording

The caret will return to the same logical position as before, just as expected.
You can assign that macro to any keyboard shortcut you like: Settings | Keymap | Macros.
Thanks for reply, Anna!

Yes, i already tried it. But it work's not exactly same as native comment hotkey: in python, if i selected a few lines and caret stay on bottom line of selection, and use thats macros - then after caret will be moved up, but with standard hotkey - it's not moving, and that better, i think.

Ладно, видимо ничего лучше с этим всё равно не сделать, спасибо и на этом.

This is super annoying - why does it do that anyway?




I'd say that this is more expected behavior because most likely one wants to comment out the line of code and then go to the next one.

Feel free to submit a usability problem ticket to https://youtrack.jetbrains.com/issues/PY though so that other users can upvote.



> most likely one wants to comment out the line of code and then go to the next one.

I see nothing to substantiate this.

Plus it overlooks the case of uncommenting out the line of code and then wanting to edit it. There is no reasonable expectation one would want to comment out a line of code and then necessarily edit the next one.