-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Virtually prevent pushing code down when new lines are automatically added #94173
Comments
Technically, the editor does not scroll. The scrollTop is maintained. It just happens that everything is pushed down by the auto-import which inserts a line at the top of the file. @jrieken This can be done from the outside if you know there are edits unrelated to the current cursor position in the suggestion e.g.: const scrollState = StableEditorScrollState.capture(this._editor);
// apply edits unrelated to current cursor position ...
scrollState.restore(this._editor); |
I'd like to help out with this! Any additional pointers would be appreciated. |
This is where the first potential edit happens:
|
…ggestion Feature #94173: Scroll when inserting suggestion
to verify:
|
I would like an option to virtually prevent vscode from pushing down the current focused line when new lines are automatically added. For example, when I click to automatically add an import, vscode adds the import line and the current focused line is scrolled down. This causes a distraction because the line I'm working on is moved away even tho I didn't want to scroll.
Here is a gif showing how IntelliJ behavior when new lines are automatically added above the current selected line. Note that after the import statement is added the current line is virtually kept the same (the line number do change, of course, but the scroll is set to a new position in order to respect the old position):
The next gif show how vscode pushes down the code and loses the previous virtual position:
Would be possible to add an option to vscode behavior like IntelliJ in this situation?
The text was updated successfully, but these errors were encountered: