Skip to content

Commit 120e4d3

Browse files
committed
Add save as code snippet command to non-notebook file
1 parent 9e4bdd6 commit 120e4d3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,18 @@ function activateCodeSnippet(
169169
}
170170
});
171171

172-
//Put the command above in context menu
172+
// Put the saveCommand above in context menu
173173
app.contextMenu.addItem({
174174
command: saveCommand,
175175
selector: '.jp-Cell'
176176
});
177177

178+
// Put the saveCommand in non-notebook file context menu
179+
app.contextMenu.addItem({
180+
command: saveCommand,
181+
selector: '.jp-FileEditor'
182+
});
183+
178184
// Add keybinding to save
179185
app.commands.addKeyBinding({
180186
command: saveCommand,

0 commit comments

Comments
 (0)