Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor position is intermittently jumpy when switching tabs #41968

Closed
eamodio opened this issue Jan 22, 2018 · 11 comments
Closed

Editor position is intermittently jumpy when switching tabs #41968

eamodio opened this issue Jan 22, 2018 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug code-lens editor-core Editor basic functionality verified Verification succeeded
Milestone

Comments

@eamodio
Copy link
Contributor

eamodio commented Jan 22, 2018

  • VSCode Version: Code 1.19.2 (490ef76, 2018-01-10T15:55:03.538Z)
  • OS Version: Windows_NT x64 10.0.17074

I haven't yet figured out a real rhyme or reason yet, but the current editor position when switching tabs is preserved (restored) properly. In some cases switching back and forth between tabs will cause the editor position to shift down by 1 line (after each tab switch) probably code lens related, while other times it will stay stable (even if the document has code lens to show). But sometimes (less frequently) the position can jump by a much larger number of line (sometimes by a hundred or more). I can't reproduce this all the time, but once it starts with a document, it seems to persist (jumps all around each switch -- sometimes even going back to the original switch line). I seem to have had better luck causing this if the find widget is open, but it definitely happens even with out it.

This can only be reproduced with code lens enabled -- setting "editor.codeLens": false causes the editor position to always be restored properly

Steps to Reproduce:

  1. Open a document scroll down to some position (note the top line)
  2. Open another document and do the same
  3. Switch back and forth and notice that the editors move down by at least 1 line (and might jump around more)
  4. Open the find widget on one of the documents and repeat 3 -- should notice that the editor can jump around seemingly randomly now

Might need to use a larger file to see the behavior more easily

Reproduces without extensions: Yes/No

@vscodebot vscodebot bot added editor editor-core Editor basic functionality labels Jan 22, 2018
@jrieken
Copy link
Member

jrieken commented Jan 23, 2018

Switch back and forth and notice that the editors move down by at least 1 line (and might jump around more)

It jumps because the code-lens appear/disappear?

@jrieken
Copy link
Member

jrieken commented Jan 23, 2018

is this #19917?

@eamodio
Copy link
Contributor Author

eamodio commented Jan 23, 2018

No it isn't just that the code lens is showing. Say the top line of the document is 100 when you switch it will be 101 then 102 etc each time you switch. Or sometimes it will jump much greater -- the top line will be ~200, ~300 which is easier to reproduce with the find widget open. The shift by 1 line is annoying, but the other completely loses the place you were at in the file

@jrieken
Copy link
Member

jrieken commented Jan 23, 2018

And this is with or without extensions?

@eamodio
Copy link
Contributor Author

eamodio commented Jan 25, 2018

This is reproducible without extensions.

Here is a GIF showing it with all extensions disabled (running with --disable-extensions)
tab-switching

@jrieken
Copy link
Member

jrieken commented Jan 26, 2018

Is does look like #19917... What happens is that editor used the n-1 code lenses and now that a new model comes it they are invalidated, resolved, and replaces. Instead of just staying stable for a while...

@eamodio
Copy link
Contributor Author

eamodio commented Jan 26, 2018

I'm sorry but I really don't think these are related -- #19917 seems like people don't like that the code "moves" because of code lens. The code has always moved in response to code lens being added into the document, but this isn't that. Before 1.19 this was far more stable. This is about the stability of keeping your view in view -- look at the line numbers at the top. You will see at first that it keeps moving down, at first by 1 or 2, but then you will see it jump more, and then when I open the find box, it jumps by tens (and then hundreds) of lines. Switching tabs should not cause you to lose context of what you were looking at.

@jrieken jrieken added the bug Issue identified by VS Code Team member as probable bug label Jan 26, 2018
@jrieken
Copy link
Member

jrieken commented Jan 26, 2018

Just looked at this with @alexandrudima. A little jumpiness is expected (still bad) and bigs jumps are harder to understand. We will investigate.

@ravid7000
Copy link

Something similar issue encounter. It do not hold position of horizontal scrollbars. It reset to zero while switching between tabs.

ezgif com-video-to-gif 1

@mattacosta
Copy link
Contributor

This still occurs with the find widget open.

Version 1.22.0-insider
Commit 95b0cff
Date 2018-03-28T05:17:37.707Z

@jrieken jrieken added the verified Verification succeeded label Mar 28, 2018
@alexdima alexdima removed verified Verification succeeded editor labels Mar 28, 2018
@alexdima
Copy link
Member

alexdima commented Mar 28, 2018

I pushed a change to further improve this also in the find widget + code lens case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug code-lens editor-core Editor basic functionality verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants