Skip to content

Commit f2556bd

Browse files
committed
Setting to enable/disable extension
1 parent 50c02f2 commit f2556bd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

schema/vim.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
"title": "Vim Notebook Cell",
55
"description": "Vim Notebook Cell Settings",
66
"properties": {
7+
"enable": {
8+
"type": "boolean",
9+
"title": "Enable",
10+
"description": "Whether to enable the extension.",
11+
"default": true
12+
}
713
},
814
"type": "object"
915
}

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ function activateCellVim(app: JupyterFrontEnd, tracker: INotebookTracker, settin
198198
const { commands, shell } = app;
199199

200200
Promise.all([settingRegistry.load(id), app.restored]).then(([settings, args]) => {
201+
const enabled = settings.get('enable').composite as boolean;
202+
if (enabled === false) {
203+
return;
204+
}
201205
function getCurrent(args: ReadonlyJSONObject): NotebookPanel | null {
202206
const widget = tracker.currentWidget;
203207
const activate = args['activate'] !== false;

0 commit comments

Comments
 (0)