Prefer moving caret line to minimize editor scrolling
Answered
This new editor option is great.
Please everybody try it and give feedback:
IDE Settings -> Editor -> Scrolling
However it should really keep a little more border to top and bottom,
to ensure that I can see enough context.
I would prefer three to five lines - an option below the radio button
would be even nicer, so that everybody can set the number of lines
according to their monitor size and preference.
Please sign in to leave a comment.
Tried it, can't stand it. It doesn't give me enough feedback as to where the cursor has moved to. That's why we have configuration flags, I guess.
--Dave Griffith.
Have you turned off highlighting of the line where the cursor is? If you have, that may make it easier to spot.
Ciao,
Gordon
Sorry for asking dump questions, but what exactly is controlled by this setting? I don't see any difference after changing it...
Martin Fuhrer wrote:
It's a little detail, but to me it makes a big difference.
For example let's say you search for the string "foo" in the current
document and the next occurence is five lines below the current caret line.
With this option checked Idea will simply position the caret to that line
(if it's already on screen).
Without this option ("classic Idea behaviour) Idea will scroll the editor
so that the line with that occurences is centered, and will cause me to
loose orientation.
Another example is stepping from line to line in the debuger. Idea will
simply move the caret and highlight one line down as opposed to constantly
scrolling the editor.
Thanks for the heads up. I was also one of the advocates of this features and
am happy it got implemented.
I agree that a bit more control over the size of the context would be useful.
Bonny
After playing with this feature for a while, I think there's a slight misunderstanding
on what this feature should really achieve.
When supporting the request for this feature, I had imagined that the feature will
be implemented for a subset of the non linear navigation actions one can perform.
In particular, this feature should, in my mind, be only enabled for those actions
that perform a repeat of a search and that are likely to remain in the same source
file - so things like search next (F3) would behave like this.
However, I think other NL navigation actions should scroll the canvas, if the target
of the action is not visible. So for example, if I Go To Implementation, and the
implementation is NOT visible, this should centre the line in the editor when the
implementation source is made visible.
I also would like to repeat Stephen's request that the number of context lines
would increase or be configurable.
Cheers,
Bonny
I find the new scroll-mode annoying while debugging, because one does not
see the next steps at the bottom of the window. IMHO while debugging the old
scroll-mode should be used - no matter what the option says.
Tom
Just tangentially related: i miss the behavior of other editors, where scrolling while holding ctrl keeps the caret in place, even if it means that the caret scrolls out of view. Exactly as idea does when scrolling with mouse wheel.
Kolmanjindrich5
Exactly this scrolling behavior works in IntelliJ IDEA when using Ctrl+up/down arrows.
no, my point is that in intellij, when using Ctrl+up/down arrows, the caret eventually changes position relative to the document, in order to stay within view. This makes it tedious to go back..
Can't reproduce in IntelliJ IDEA 2020.3.2 release, the caret doesn't change the position when scrolling with ctrl+up/down arrows.
Does not change position relative to text? Can you please confirm this even when you scroll so far that the caret would scroll out of view? Thanks
Yes, stays even off screen like when scrolling with mouse.
with mouse yes, but not when scrollinig with ctrl+up/down arrows, right?
It works the same as with mouse when scrolling with the keys and holding Ctrl.
I see, it works as you describe when i try with clean config. Any idea what setting could be causing this? I cannot find anything
I had Ctrl+Down set to "Scroll Down and Move if Necessary"