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.
2 comments
Comment actions Permalink
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.
0
Comment actions Permalink
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.

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

Please sign in to leave a comment.