Prefer moving caret line to minimize editor scrolling

已回答

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.

0
Avatar
Permanently deleted user

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.

0
Avatar
Permanently deleted user

Have you turned off highlighting of the line where the cursor is? If you have, that may make it easier to spot.

Ciao,
Gordon

0
Avatar
Permanently deleted user

Sorry for asking dump questions, but what exactly is controlled by this setting? I don't see any difference after changing it...

0
Avatar
Permanently deleted user

Martin Fuhrer wrote:

Sorry for asking dump questions, but what exactly is controlled by this setting? I don't see any difference after changing it...


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.

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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.

0

Kolmanjindrich5

Exactly this scrolling behavior works in IntelliJ IDEA when using Ctrl+up/down arrows.

0
Avatar
Permanently deleted user

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..

0

Can't reproduce in IntelliJ IDEA 2020.3.2 release, the caret doesn't change the position when scrolling with ctrl+up/down arrows.

0
Avatar
Permanently deleted user

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

0

Yes, stays even off screen like when scrolling with mouse.

0
Avatar
Permanently deleted user

with mouse yes, but not when scrollinig with ctrl+up/down arrows, right?

0

It works the same as with mouse when scrolling with the keys and holding Ctrl.

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

I had Ctrl+Down set to "Scroll Down and Move if Necessary"

0

请先登录再写评论。