Skip to content

Commit fdd1492

Browse files
authored
Merge pull request microsoft#104373 from microsoft/joao/release/1.48/104299
Fixes microsoft#104299
2 parents 836fbb1 + cd17997 commit fdd1492

4 files changed

Lines changed: 35 additions & 0 deletions

File tree

src/vs/workbench/contrib/markers/browser/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default {
1717
MARKERS_VIEW_CLEAR_FILTER_TEXT: 'problems.action.clearFilterText',
1818
MARKERS_VIEW_SHOW_MULTILINE_MESSAGE: 'problems.action.showMultilineMessage',
1919
MARKERS_VIEW_SHOW_SINGLELINE_MESSAGE: 'problems.action.showSinglelineMessage',
20+
MARKER_OPEN_ACTION_ID: 'problems.action.open',
2021
MARKER_OPEN_SIDE_ACTION_ID: 'problems.action.openToSide',
2122
MARKER_SHOW_PANEL_ID: 'workbench.action.showErrorsWarnings',
2223
MARKER_SHOW_QUICK_FIX: 'problems.action.showQuickFixes',

src/vs/workbench/contrib/markers/browser/markers.contribution.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ import { Codicon } from 'vs/base/common/codicons';
3636

3737
registerSingleton(IMarkersWorkbenchService, MarkersWorkbenchService, false);
3838

39+
KeybindingsRegistry.registerCommandAndKeybindingRule({
40+
id: Constants.MARKER_OPEN_ACTION_ID,
41+
weight: KeybindingWeight.WorkbenchContrib,
42+
when: ContextKeyExpr.and(Constants.MarkerFocusContextKey),
43+
primary: KeyCode.Enter,
44+
mac: {
45+
primary: KeyCode.Enter,
46+
secondary: [KeyMod.CtrlCmd | KeyCode.DownArrow]
47+
},
48+
handler: (accessor, args: any) => {
49+
const markersView = accessor.get(IViewsService).getActiveViewWithId<MarkersView>(Constants.MARKERS_VIEW_ID)!;
50+
markersView.openFileAtElement(markersView.getFocusElement(), false, false, true);
51+
}
52+
});
53+
3954
KeybindingsRegistry.registerCommandAndKeybindingRule({
4055
id: Constants.MARKER_OPEN_SIDE_ACTION_ID,
4156
weight: KeybindingWeight.WorkbenchContrib,

src/vs/workbench/contrib/search/browser/search.contribution.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,24 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
9494
}
9595
});
9696

97+
KeybindingsRegistry.registerCommandAndKeybindingRule({
98+
id: Constants.OpenMatch,
99+
weight: KeybindingWeight.WorkbenchContrib,
100+
when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.FileMatchOrMatchFocusKey),
101+
primary: KeyCode.Enter,
102+
mac: {
103+
primary: KeyCode.Enter,
104+
secondary: [KeyMod.CtrlCmd | KeyCode.DownArrow]
105+
},
106+
handler: (accessor) => {
107+
const searchView = getSearchView(accessor.get(IViewsService));
108+
if (searchView) {
109+
const tree: WorkbenchObjectTree<RenderableMatch> = searchView.getControl();
110+
searchView.open(<FileMatchOrMatch>tree.getFocus()[0], false, false, true);
111+
}
112+
}
113+
});
114+
97115
KeybindingsRegistry.registerCommandAndKeybindingRule({
98116
id: Constants.OpenMatchToSide,
99117
weight: KeybindingWeight.WorkbenchContrib,

src/vs/workbench/contrib/search/common/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const FindInFilesActionId = 'workbench.action.findInFiles';
99
export const FocusActiveEditorCommandId = 'search.action.focusActiveEditor';
1010

1111
export const FocusSearchFromResults = 'search.action.focusSearchFromResults';
12+
export const OpenMatch = 'search.action.openResult';
1213
export const OpenMatchToSide = 'search.action.openResultToSide';
1314
export const CancelActionId = 'search.action.cancel';
1415
export const RemoveActionId = 'search.action.remove';

0 commit comments

Comments
 (0)