Skip to content

Commit 1b25a13

Browse files
authored
Fix microsoft#160621. Do no steal escape when focus is in input. (microsoft#203746)
1 parent 6b48dfc commit 1b25a13

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
2727
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
2828
import { OneReference, ReferencesModel } from '../referencesModel';
2929
import { LayoutData, ReferenceWidget } from './referencesWidget';
30+
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
31+
import { InputFocusedContext } from 'vs/platform/contextkey/common/contextkeys';
3032

3133
export const ctxReferenceSearchVisible = new RawContextKey<boolean>('referenceSearchVisible', false, nls.localize('referenceSearchVisible', "Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));
3234

@@ -367,7 +369,14 @@ KeybindingsRegistry.registerKeybindingRule({
367369
weight: KeybindingWeight.WorkbenchContrib + 50,
368370
primary: KeyCode.Escape,
369371
secondary: [KeyMod.Shift | KeyCode.Escape],
370-
when: ContextKeyExpr.and(ctxReferenceSearchVisible, ContextKeyExpr.not('config.editor.stablePeek'))
372+
when: ContextKeyExpr.and(
373+
ctxReferenceSearchVisible,
374+
ContextKeyExpr.not('config.editor.stablePeek'),
375+
ContextKeyExpr.or(
376+
EditorContextKeys.editorTextFocus,
377+
InputFocusedContext.negate()
378+
)
379+
)
371380
});
372381

373382

0 commit comments

Comments
 (0)