Seed Quick Open (Ctrl+P) filter value from editor selection - #330538
Open
Jade Ferreira Vieira (jadefr) wants to merge 2 commits into
Open
Seed Quick Open (Ctrl+P) filter value from editor selection#330538Jade Ferreira Vieira (jadefr) wants to merge 2 commits into
Jade Ferreira Vieira (jadefr) wants to merge 2 commits into
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
Copilot started reviewing on behalf of
Jade Ferreira Vieira (jadefr)
August 12, 2026 20:26
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Seeds Quick Open from an explicit editor selection.
Changes:
- Uses selected single-line text as the Quick Open filter.
- Adds an unrelated Alt+Click tab-closing gesture.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
anythingQuickAccess.ts |
Seeds the Quick Open filter from editor selection. |
multiEditorTabsControl.ts |
Adds Alt+Click handling for closing other tabs. |
Suppressed comments (1)
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts:950
- This closes the other editors on
mousedown, but preventing/stoppingmousedowndoes not cancel the subsequentclick. Since the ActionBar already displays and runsCloseOtherEditorTabsInGroupActionwhile Alt is held, one gesture can start two concurrentcloseEditorsoperations, potentially duplicating dirty-editor prompts or racing closure. Remove this extra listener and rely on the existing action.
const tabActionsAltClickListener = addDisposableListener(tabActionsContainer, EventType.MOUSE_DOWN, e => {
if (!isMouseEvent(e) || e.button !== 0 || !e.altKey) {
return;
}
EventHelper.stop(e, true);
const editor = this.tabsModel.getEditorByIndex(tabIndex);
if (!editor) {
return;
}
this.blockRevealActiveTabOnce();
const editorsToClose = this.groupView.getEditors(EditorsOrder.SEQUENTIAL, { excludeSticky: true }).filter(other => !other.matches(editor));
this.groupView.closeEditors(editorsToClose);
}, true /* capture */);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+932
to
+934
| // Alt+Click to close other tabs | ||
| // Closes every other non-sticky tab, leaving the current tab open | ||
| const tabActionsAltClickListener = addDisposableListener(tabActionsContainer, EventType.MOUSE_DOWN, e => { |
| // Prefer the current editor selection as default filter, but only an explicit selection (unlike Ctrl+T, an idle cursor's word would fire on nearly every invocation) | ||
| const editor = this.codeEditorService.getFocusedCodeEditor(); | ||
| if (editor) { | ||
| return getSelectionSearchString(editor, 'single', true) ?? undefined; |
Mirrors the same pattern workspace symbol search (Ctrl+T) already uses via getSelectionSearchString, JetBrains-style.
Ctrl+T falls back to the word under an idle cursor, which is fine for symbol search. For Ctrl+P that fallback fired on nearly every invocation, pre-filling the filter with whatever word the cursor happened to sit on instead of leaving it empty for a filename.
Jade Ferreira Vieira (jadefr)
force-pushed
the
feature/quick-open-selected-text
branch
from
August 12, 2026 21:30
57c61f0 to
1d70a54
Compare
Copilot started reviewing on behalf of
Jade Ferreira Vieira (jadefr)
August 12, 2026 22:30
View session
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 text is selected in the editor and you press Ctrl+P, Quick Open now pre-fills
the filter with that selection.
This is the same existing behavior of Find in Files (Ctrl+Shift+F) and Go to Symbol (Ctrl+T).
It only seeds from an explicit, non-empty selection. Intentionally it does not honor
editor.find.seedSearchStringFromSelection, since that setting's default would introduce word-at-cursor seeding here.