Skip to content

Commit 4cdbe3f

Browse files
authored
Merge pull request #177 from jahn96/command
Fix snippet commands misplaced in right click menu
2 parents a28a0a2 + 11f55cf commit 4cdbe3f

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/index.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,41 @@ function activateCodeSnippet(
212212
});
213213

214214
// Put the saveCommand above in context menu
215+
app.contextMenu.addItem({
216+
type: 'separator',
217+
selector: '.jp-Notebook',
218+
rank: 13,
219+
});
220+
215221
app.contextMenu.addItem({
216222
command: saveCommand,
217-
selector: '.jp-Cell',
223+
selector: '.jp-Notebook',
224+
rank: 14,
225+
});
226+
227+
app.contextMenu.addItem({
228+
type: 'separator',
229+
selector: '.jp-Notebook',
230+
rank: 15,
218231
});
219232

220233
// Put the saveCommand in non-notebook file context menu
234+
app.contextMenu.addItem({
235+
type: 'separator',
236+
selector: '.jp-FileEditor',
237+
rank: 7,
238+
});
239+
221240
app.contextMenu.addItem({
222241
command: saveCommand,
223242
selector: '.jp-FileEditor',
243+
rank: 8,
244+
});
245+
246+
app.contextMenu.addItem({
247+
type: 'separator',
248+
selector: '.jp-FileEditor',
249+
rank: 9,
224250
});
225251

226252
// Track and restore the widget state

0 commit comments

Comments
 (0)