mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 10:40:41 +00:00
Always allow ctrl+up to focus the chat list on windows (#203982)
This commit is contained in:
parent
dbd391ebba
commit
a3d4451154
|
@ -34,6 +34,7 @@ import { IChatDetail, IChatService } from 'vs/workbench/contrib/chat/common/chat
|
|||
import { IChatWidgetHistoryService } from 'vs/workbench/contrib/chat/common/chatWidgetHistoryService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { IsLinuxContext, IsWindowsContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
|
||||
export const CHAT_CATEGORY = localize2('chat.category', 'Chat');
|
||||
export const CHAT_OPEN_ACTION_ID = 'workbench.action.chat.open';
|
||||
|
@ -192,13 +193,22 @@ export function registerChatActions() {
|
|||
super({
|
||||
id: 'chat.action.focus',
|
||||
title: localize2('actions.interactiveSession.focus', 'Focus Chat List'),
|
||||
precondition: ContextKeyExpr.and(CONTEXT_IN_CHAT_INPUT, CONTEXT_CHAT_INPUT_CURSOR_AT_TOP),
|
||||
precondition: CONTEXT_IN_CHAT_INPUT,
|
||||
category: CHAT_CATEGORY,
|
||||
keybinding: {
|
||||
when: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.UpArrow,
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
}
|
||||
keybinding: [
|
||||
// On mac, require that the cursor is at the top of the input, to avoid stealing cmd+up to move the cursor to the top
|
||||
{
|
||||
when: CONTEXT_CHAT_INPUT_CURSOR_AT_TOP,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.UpArrow,
|
||||
weight: KeybindingWeight.EditorContrib,
|
||||
},
|
||||
// On win/linux, ctrl+up can always focus the chat list
|
||||
{
|
||||
when: ContextKeyExpr.or(IsWindowsContext, IsLinuxContext),
|
||||
primary: KeyMod.CtrlCmd | KeyCode.UpArrow,
|
||||
weight: KeybindingWeight.EditorContrib,
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue