-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redirect text editor commands to null when focused in webview text ed…
…itor
- Loading branch information
Showing
5 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/nullCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { KeyCode } from 'vs/base/common/keyCodes'; | ||
import { registerAction2, Action2 } from 'vs/platform/actions/common/actions'; | ||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; | ||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; | ||
import { NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_INPUT_FOCUSED } from 'vs/workbench/contrib/notebook/common/notebookContextKeys'; | ||
|
||
registerAction2(class NullAction extends Action2 { | ||
constructor() { | ||
super({ | ||
id: 'notebook.nullCommand', | ||
title: 'Null Command', | ||
f1: false, | ||
keybinding: [ | ||
{ | ||
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_INPUT_FOCUSED), | ||
primary: KeyCode.DownArrow, | ||
weight: KeybindingWeight.WorkbenchContrib + 1 | ||
}, | ||
{ | ||
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_INPUT_FOCUSED), | ||
primary: KeyCode.UpArrow, | ||
weight: KeybindingWeight.WorkbenchContrib + 1 | ||
}, | ||
{ | ||
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_INPUT_FOCUSED), | ||
primary: KeyCode.Delete, | ||
weight: KeybindingWeight.WorkbenchContrib + 1 | ||
}, | ||
{ | ||
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_INPUT_FOCUSED), | ||
primary: KeyCode.Enter, | ||
weight: KeybindingWeight.WorkbenchContrib + 1 | ||
} | ||
] | ||
}); | ||
} | ||
|
||
run() { | ||
//noop | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters