-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Comments
It jumps because the code-lens appear/disappear? |
is this #19917? |
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 |
And this is with or without extensions? |
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... |
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. |
Just looked at this with @alexandrudima. A little jumpiness is expected (still bad) and bigs jumps are harder to understand. We will investigate. |
This still occurs with the find widget open. Version 1.22.0-insider |
I pushed a change to further improve this also in the find widget + code lens case. |
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 properlySteps to Reproduce:
Might need to use a larger file to see the behavior more easily
Reproduces without extensions: Yes/No
The text was updated successfully, but these errors were encountered: