Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extensions/references-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,12 @@
},
{
"command": "references-view.next",
"when": "reference-list.hasResult",
"when": "reference-list.hasResult && focusedView == 'references-view.tree'",
"key": "f4"
},
{
"command": "references-view.prev",
"when": "reference-list.hasResult",
"when": "reference-list.hasResult && focusedView == 'references-view.tree'",
"key": "shift+f4"
},
{
Expand Down
9 changes: 9 additions & 0 deletions src/vs/workbench/contrib/search/browser/searchActionsNav.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change anything in this file. Only changes into references-view are allowed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted all changes to searchActionsNav.ts in commit 1cd588f. Only the references-view/package.json file is now modified, which adds the focusedView context check to ensure F4 only navigates references when that view is focused.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ import { category, getSearchView, openSearchView } from './searchActionsBase.js'
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from '../../../../platform/accessibility/common/accessibility.js';
import { getActiveElement } from '../../../../base/browser/dom.js';
import { FileMatchOrMatch, RenderableMatch, ISearchResult, isSearchTreeFolderMatch } from './searchTreeModel/searchTreeCommon.js';
import { FocusedViewContext } from '../../../common/contextkeys.js';
import { VIEW_ID } from '../../../services/search/common/search.js';

const SearchNavigationKeybindingWhen = ContextKeyExpr.and(
ContextKeyExpr.or(Constants.SearchContext.HasSearchResults, SearchEditorConstants.InSearchEditor),
ContextKeyExpr.equals(FocusedViewContext.key, VIEW_ID)
);

//#region Actions: Changing Search Input Options
registerAction2(class ToggleQueryDetailsAction extends Action2 {
Expand Down Expand Up @@ -360,6 +367,7 @@ registerAction2(class FocusNextSearchResultAction extends Action2 {
keybinding: [{
primary: KeyCode.F4,
weight: KeybindingWeight.WorkbenchContrib,
when: SearchNavigationKeybindingWhen,
}],
category,
f1: true,
Expand All @@ -380,6 +388,7 @@ registerAction2(class FocusPreviousSearchResultAction extends Action2 {
keybinding: [{
primary: KeyMod.Shift | KeyCode.F4,
weight: KeybindingWeight.WorkbenchContrib,
when: SearchNavigationKeybindingWhen,
}],
category,
f1: true,
Expand Down