Skip to content

Commit 8852f4a

Browse files
authored
Always hide cut/copy/paste menu in the notebooks (microsoft#208297)
* Include execution count in notebook diff * Fix tests * Misc changes * Fix tests * Fix more tests * Always hide cut/copy/paste menu in the notebooks
1 parent 22b6f2f commit 8852f4a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestCont
4141
import * as nls from 'vs/nls';
4242
import { MenuId } from 'vs/platform/actions/common/actions';
4343
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
44-
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
44+
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
4545
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
4646
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
4747
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
@@ -102,6 +102,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
102102
import { OutlineTarget } from 'vs/workbench/services/outline/browser/outline';
103103
import { PixelRatio } from 'vs/base/browser/pixelRatio';
104104
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
105+
import { PreventDefaultContextMenuItemsContextKeyName } from 'vs/workbench/contrib/webview/browser/webview.contribution';
105106
import { NotebookAccessibilityProvider } from 'vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider';
106107

107108
const $ = DOM.$;
@@ -420,6 +421,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
420421
this._outputInputFocus = NOTEBOOK_OUPTUT_INPUT_FOCUSED.bindTo(this.scopedContextKeyService);
421422
this._editorEditable = NOTEBOOK_EDITOR_EDITABLE.bindTo(this.scopedContextKeyService);
422423
this._cursorNavMode = NOTEBOOK_CURSOR_NAVIGATION_MODE.bindTo(this.scopedContextKeyService);
424+
// Never display the native cut/copy context menu items in notebooks
425+
new RawContextKey<boolean>(PreventDefaultContextMenuItemsContextKeyName, false).bindTo(this.scopedContextKeyService).set(true);
423426

424427
this._editorEditable.set(!creationOptions.isReadOnly);
425428

0 commit comments

Comments
 (0)