Restore view states of revealed editors in other groups when Quick Open closes#288041
Closed
Restore view states of revealed editors in other groups when Quick Open closes#288041
Conversation
…en closes Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add option for Go To File not to scroll in unfocused editors
Restore view states of revealed editors in other groups when Quick Open closes
Jan 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using Quick Open to navigate to a symbol (e.g.,
file@symbol) in a file already visible in another split view, that view scrolls to show the symbol. On accept or cancel, the scroll position was lost.Changes
PickerEditorState(quickaccess.ts):revealedEditorsInOtherGroupsmaprevealIfOpenedopens an editor in another grouprestoreEditorViewStates()to restore just revealed editors' view statesrestoreEditorViewStates()fromrestore()on cancelAnythingQuickAccessProvider(anythingQuickAccess.ts):restoreEditorViewStates()on accept when opening to active groupTest (
quickAccess.test.ts):restoreEditorViewStateswith multiple editor groupsBehavior
Implements Solution C from the issue discussion: keep
revealIfOpenedbehavior for symbol preview, but restore scroll positions in other groups when the picker closes (both ESC and ENTER).Original prompt
This section details on the original issue you should resolve
<issue_title>Consider option for Go To File.../Quick Open not to scroll to symbols in unfocused editors / splits</issue_title>
<issue_description>
When launching the Go To File... / Quick Open palette to navigate to a symbol in another file with multiple views open, if that file is open (even in a tab which is not currently active) in an unfocused split view, the other view will scroll to that symbol's position. For me, this is disruptive: I want to keep that view in it's current position for reference while I edit another position in my current view. (This is how it would work in Sublime Text, where the file / symbol launcher seems to be per-view rather than global.)
In case that paragraph was unclear or if I have used some terminology wrong, I'll give a concrete example (also asked on StackOverflow here):
Is there a way to change VS Code's behavior to be like Sublime's here? If not, would it be possible to consider this as a feature request? Thanks!</issue_description>
<agent_instructions>make it nice</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@TylerLeonhardt Yeah I see this behaviorScreen.Recording.2025-11-14.at.4.13.08.PM.mov
similar but not as bad behavior is when you ctrl+enter which should open a file to the right side:
Screen.Recording.2025-11-14.at.4.32.47.PM.mov
It does, but it leaves behind the file in the previous group.
I do think that showing the editor is useful (it might even be needed to get the fully resolved symbols), but I think it should:
I'm pretty sure this is caused by this open
openTransientEditor:vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
Lines 936 to 939 in 817c9ac
and this openEditor with ACTIVE_GROUP as the target:
vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
Line 1128 in 817c9ac
@bpasero before I go playing with any of this, do you recall any technical reasons for doing the current behavior?</comment_new>
<comment_new>@bpasero
This is caused by using
revealIfOpenedwhich will always prefer an editor that is opened anywhere to reveal and show. I think you are asking for trouble if you were to change that because a lot of users likely rely on it that are annoyed if the current editor gets replaced.</comment_new><comment_new>@TylerLeonhardt
@bpasero What I see feels like a bug (which is shown in the videos):
symbolfoo@symbol, which causes group 1's instance of foo.ts to revealMy expectation would be either:
Additionally, what @cwindolf really wants maybe, there could be a setting to disable this
revealIfOpenedand instead prefer the active group.</comment_new><comment_new>@bpasero
@TylerLeonhardt yeah arguably the revealing of the editor in group 1 should be reset once the final editor is opened in group 2.
I see 2 possible fixes: either we reveal the editor always in the same group (which would match the final ...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.