提交 c96af39b 编写于 作者: A Alex Dima

Improve default linux keybindings for move lines and add cursors

上级 429886c9
......@@ -155,7 +155,8 @@ registerCoreCommand(H.CursorUp, {
registerCoreCommand(H.CursorUpSelect, {
primary: KeyMod.Shift | KeyCode.UpArrow,
secondary: [getWordNavigationKB(true, KeyCode.UpArrow)],
mac: { primary: KeyMod.Shift | KeyCode.UpArrow }
mac: { primary: KeyMod.Shift | KeyCode.UpArrow },
linux: { primary: KeyMod.Shift | KeyCode.UpArrow }
});
registerCoreCommand(H.CursorDown, {
primary: KeyCode.DownArrow,
......@@ -164,7 +165,8 @@ registerCoreCommand(H.CursorDown, {
registerCoreCommand(H.CursorDownSelect, {
primary: KeyMod.Shift | KeyCode.DownArrow,
secondary: [getWordNavigationKB(true, KeyCode.DownArrow)],
mac: { primary: KeyMod.Shift | KeyCode.DownArrow }
mac: { primary: KeyMod.Shift | KeyCode.DownArrow },
linux: { primary: KeyMod.Shift | KeyCode.DownArrow }
});
registerCoreCommand(H.CursorPageUp, {
primary: KeyCode.PageUp
......
......@@ -242,12 +242,12 @@ CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(TrimTrailin
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(MoveLinesDownAction, MoveLinesDownAction.ID, nls.localize('lines.moveDown', "Move Line Down"), {
context: ContextKey.EditorTextFocus,
primary: KeyMod.Alt | KeyCode.DownArrow,
linux: { primary: KeyMod.CtrlCmd | KeyCode.DownArrow }
linux: { primary: KeyMod.Alt | KeyCode.DownArrow }
}));
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(MoveLinesUpAction, MoveLinesUpAction.ID, nls.localize('lines.moveUp', "Move Line Up"), {
context: ContextKey.EditorTextFocus,
primary: KeyMod.Alt | KeyCode.UpArrow,
linux: { primary: KeyMod.CtrlCmd | KeyCode.UpArrow }
linux: { primary: KeyMod.Alt | KeyCode.UpArrow }
}));
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(CopyLinesDownAction, CopyLinesDownAction.ID, nls.localize('lines.copyDown', "Copy Line Down"), {
context: ContextKey.EditorTextFocus,
......
......@@ -32,10 +32,16 @@ class InsertCursorBelow extends HandlerEditorAction {
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(InsertCursorAbove, InsertCursorAbove.ID, nls.localize('mutlicursor.insertAbove', "Insert Cursor Above"), {
context: ContextKey.EditorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.UpArrow,
linux: { primary: KeyMod.CtrlCmd| KeyMod.WinCtrl | KeyCode.UpArrow }
linux: {
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.UpArrow,
secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow]
}
}));
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(InsertCursorBelow, InsertCursorBelow.ID, nls.localize('mutlicursor.insertBelow', "Insert Cursor Below"), {
context: ContextKey.EditorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.DownArrow,
linux: { primary: KeyMod.CtrlCmd| KeyMod.WinCtrl | KeyCode.DownArrow }
linux: {
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.DownArrow,
secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.DownArrow]
}
}));
......@@ -103,11 +103,6 @@ class KeybindingsRegistryImpl implements IKeybindingsRegistry {
}
}
}
if (Platform.isLinux) {
if (!BinaryKeybindings.hasCtrlCmd(keybinding) && !BinaryKeybindings.hasShift(keybinding) && BinaryKeybindings.hasAlt(keybinding) && !BinaryKeybindings.hasWinCtrl(keybinding)) {
console.warn('Alt+ keybindings should not be used by default under Linux. Offender: ', keybinding, ' for ', commandId);
}
}
this._keybindings.push({
keybinding: keybinding,
command: commandId,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册