7

When on a C++ line of code like the following

aType.aMethod(
     std::make_shared< T_1>();
^^^^^-- Press tab here 
)

Clion tries to move to the next parameter(i guess), but being the only parameter it goes nowhere. I want to have the tab to just insert characters(tab or space that is) and not to try to cycle the cursor among the method parameter. Is there a way to stop this alternative functionality?

I searched to no avail in

Settings|Editor|CodeStyle|C/C++

Thank you

5
  • 1
    Same issue here. Cannot find the way to turn this off.
    – rareyesdev
    Jul 4, 2017 at 20:45
  • 3
    Try changing the "Next parameter" and "Previous parameter" keybindings to something else than Tab. Jul 5, 2017 at 9:02
  • 1
    @EldarAbusalimov it worked. If you write it as an answer i can just give you the the correct answer mark, otherwise i'll answer to myself.
    – splinux
    Jul 5, 2017 at 10:06
  • 3
    @splinux it's OK, please feel free to answer yourself and accept the answer! =) Jul 5, 2017 at 12:56
  • 1
    Donating rep to new users... that's true SO love <3
    – andreee
    Aug 2, 2019 at 6:41

2 Answers 2

6

"Try changing the "Next parameter" and "Previous parameter" keybindings to something else than Tab."

– Eldar Abusalimov Jul 5 '17 at 9:02

2

In addition to the accepted answer, i found that tab was assigned to Next Live Template Parameter Under : Main Menu | Navigate | Navigate in File (This is in the keymap section in settings, not the actual main menu). So when i generated definitions for the methods in my class and it jumped into the cpp if there were any auto generated functions with return initializer; as the method body it would jump to these instead of letting me indent code so i turned that off too and now i can happily implement the methods in order and fix those up when i get to them. Alternatively if you like that setting and want to keep it turned on, Hopefully knowing that you have to tidy up all instances of return initializer; before the tab key will indent code again is useful to you, i found it very confusing.

EDIT: i realise this wasn't part of the original question, but this is where googles top result brought me, so i hope you don't mind me adding this info here as its still related to the tab key doing weird things in CLion.

1
  • 1
    Thank you so much, this was driving me nuts and I find it insane that this is the default behaviour.... Jul 3, 2022 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.