Caret positioning when going back after a jump to definition

When I go to the previous caret position in CLion (using alt+left arrow or back button on my mouse) it will scroll so that the caret is barely on the screen. Can I configure it so that it restores the previous location of the caret relative to the screen as well? For example, if the caret is in the middle of the screen and I ctrl click a definition that takes me to the top of the file, when I go back it will scroll so that the line the caret was at is the last visible line on the screen. Can I make it scroll so that that line is in the middle of the screen (where it was previously) instead?

0
1 comment

Hello!

So far, I haven't managed to reproduce the issue in CLion 2026.2.1 on my side. When I use the Navigate | Back action, it restores the same scroll offset it had before navigating to a declaration/definition:

  1. What CLion version do you use?
  2. What OS do you use CLion on?
  3. Do you use CLion in a completely local setup, or do you use Remote Development?
  4. What action does “alt+left arrow” correspond to in your keymap (Settings | Keymap)? Is it the Navigate | Back action?
  5. Could you please provide a screencast illustrating the behavior you observe?
  6. Can you reproduce this behavior consistently, or does it happen randomly?
  7. Is this behavior reproducible in all projects or only specific ones? Is it reproducible, for example, in a default "C++ Executable" project (File | New Project > C++ Executable > Create)?
0

Please sign in to leave a comment.