Fixes #91051: Have Shift+Insert paste from the clipboard by default (like Ctrl+V)

This commit is contained in:
Alex Dima 2020-02-26 10:40:35 +01:00
parent afcaaa6131
commit fd407adeda
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
2 changed files with 2 additions and 12 deletions

View file

@ -161,6 +161,7 @@ class ExecCommandPasteAction extends ExecCommandAction {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] },
linux: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] },
weight: KeybindingWeight.EditorContrib
};
// Do not bind paste keybindings in the browser,

View file

@ -20,10 +20,7 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { Registry } from 'vs/platform/registry/common/platform';
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
export class SelectionClipboard extends Disposable implements IEditorContribution {
private static readonly SELECTION_LENGTH_LIMIT = 65536;
@ -119,15 +116,7 @@ class PasteSelectionClipboardAction extends EditorAction {
id: 'editor.action.selectionClipboardPaste',
label: nls.localize('actions.pasteSelectionClipboard', "Paste Selection Clipboard"),
alias: 'Paste Selection Clipboard',
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: ContextKeyExpr.and(
EditorContextKeys.editorTextFocus,
ContextKeyExpr.has('config.editor.selectionClipboard')
),
primary: KeyMod.Shift | KeyCode.Insert,
weight: KeybindingWeight.EditorContrib
}
precondition: EditorContextKeys.writable
});
}