Skip to content

Commit

Permalink
Avoid layer breaker import (#140856)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Jan 20, 2022
1 parent 295984b commit 06c13b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/vs/platform/history/browser/contextScopedHistoryWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import { HistoryInputBox, IHistoryInputOptions } from 'vs/base/browser/ui/inputb
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { ContextKeyExpr, IContextKey, IContextKeyService, IContextKeyServiceTarget, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
// eslint-disable-next-line code-import-patterns
import { Context as SuggestContext } from 'vs/editor/contrib/suggest/suggest';

// TODO@Connor: this constant is duplicated here to avoid a layer breaker import
const suggestWidgetVisibleContext = 'suggestWidgetVisible';

export const HistoryNavigationWidgetContext = 'historyNavigationWidget';
const HistoryNavigationForwardsEnablementContext = 'historyNavigationForwardsEnabled';
Expand Down Expand Up @@ -94,7 +95,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
when: ContextKeyExpr.and(
ContextKeyExpr.has(HistoryNavigationWidgetContext),
ContextKeyExpr.equals(HistoryNavigationBackwardsEnablementContext, true),
SuggestContext.Visible.isEqualTo(false),
ContextKeyExpr.equals(suggestWidgetVisibleContext, false),
),
primary: KeyCode.UpArrow,
secondary: [KeyMod.Alt | KeyCode.UpArrow],
Expand All @@ -113,7 +114,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
when: ContextKeyExpr.and(
ContextKeyExpr.has(HistoryNavigationWidgetContext),
ContextKeyExpr.equals(HistoryNavigationForwardsEnablementContext, true),
SuggestContext.Visible.isEqualTo(false),
ContextKeyExpr.equals(suggestWidgetVisibleContext, false),
),
primary: KeyCode.DownArrow,
secondary: [KeyMod.Alt | KeyCode.DownArrow],
Expand Down

0 comments on commit 06c13b6

Please sign in to comment.