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

Code screen will move up after write a unimported package method and undo #120884

Open
elricli opened this issue Apr 9, 2021 · 3 comments
Open
Assignees
Labels
feature-request Request for new features or functionality undo-redo Issues around undo/redo
Milestone

Comments

@elricli
Copy link

elricli commented Apr 9, 2021

  • VS Code Version: 1.55.1
  • OS Version: Win10

Steps to Reproduce:

  1. input the go code
  2. write a unimported package method
  3. ctrl+z
  4. repeat step 2 and 3

Does this issue occur when all extensions are disabled?: No

Disable all extension, the problem can not reproduce, maybe can not autoimport.

Screenshots or recordings:

GIF:
output

Relate issues:

@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Jun 5, 2021
@alexdima
Copy link
Member

alexdima commented Jun 5, 2021

@drrrMikado Does this reproduce if you disable all other extensions except the go extension? I have tried to reproduce with a suggestion that inserts an import, but the scroll top does not change when accepting the suggestion for me:

Kapture.2021-06-05.at.15.00.40.mp4

cc @jrieken if you ever saw something similar before.

@alexdima alexdima added info-needed Issue requires more information from poster and removed bug Issue identified by VS Code Team member as probable bug labels Jun 5, 2021
@elricli
Copy link
Author

elricli commented Jun 5, 2021

Does this reproduce if you disable all other extensions except the go extension?

Yes.

Then I tried the automatic import of python, which can also be reproduced.

@alexdima
Copy link
Member

alexdima commented Jun 5, 2021

👍 I can reproduce with go, which adds 2 lines for the import. Effectively, the extra edits insert 2 lines and the suggest controller scrolls down by 2 lines (increases scroll top by 2 * line height). When undoing, the two lines are removed, but the scroll top is maintained, thus the viewport is 2 lines lower.

So the actual request here is to record the scroll position in the undo stack.

@alexdima alexdima added feature-request Request for new features or functionality undo-redo Issues around undo/redo and removed info-needed Issue requires more information from poster labels Jun 5, 2021
@alexdima alexdima added this to the Backlog milestone Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality undo-redo Issues around undo/redo
Projects
None yet
Development

No branches or pull requests

2 participants