Skip to content

Commit

Permalink
Fix ctrl+enter and alt+enter by removing the redundant command. (#4769)
Browse files Browse the repository at this point in the history
* Fix ctrl+enter and alt+enter by removing the redundant command.

* Code review feedback
  • Loading branch information
rchiodo authored Feb 12, 2021
1 parent df8ba9a commit 4d51730
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions news/2 Fixes/4713.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix CTRL+ENTER and ALT+ENTER to behave as expected for a jupyter notebook.
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
{
"command": "jupyter.runcurrentcell",
"key": "ctrl+enter",
"when": "editorTextFocus && !editorHasSelection && jupyter.hascodecells && !notebookEditorFocused"
"when": "editorTextFocus && !editorHasSelection && jupyter.hascodecells && !notebookEditorFocused && !jupyter.havenativecells"
},
{
"command": "jupyter.runcurrentcellandaddbelow",
Expand Down Expand Up @@ -188,6 +188,11 @@
"when": "editorTextFocus && inputFocus && notebookEditorFocused && notebookViewType == jupyter-notebook && config.jupyter.enableKeyboardShortcuts",
"command": "notebook.cell.split"
},
{
"key": "ctrl+enter",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && notebookViewType == jupyter-notebook && config.jupyter.enableKeyboardShortcuts",
"command": "notebook.cell.execute"
},
{
"command": "jupyter.insertCellBelowPosition",
"key": "ctrl+; s",
Expand Down Expand Up @@ -981,25 +986,25 @@
"command": "jupyter.runcurrentcell",
"title": "%jupyter.command.jupyter.runcurrentcell.title%",
"category": "Jupyter",
"when": "jupyter.hascodecells && jupyter.ispythonornativeactive"
"when": "jupyter.hascodecells && jupyter.ispythonornativeactive && !jupyter.havenativecells"
},
{
"command": "jupyter.runcurrentcelladvance",
"title": "%jupyter.command.jupyter.runcurrentcelladvance.title%",
"category": "Jupyter",
"when": "jupyter.hascodecells && jupyter.ispythonornativeactive"
"when": "jupyter.hascodecells && jupyter.ispythonornativeactive && !jupyter.havenativecells"
},
{
"command": "jupyter.runcurrentcellandallbelow.palette",
"title": "%jupyter.command.jupyter.runcurrentcellandallbelow.palette.title%",
"category": "Jupyter",
"when": "jupyter.hascodecells && jupyter.ispythonornativeactive"
"when": "jupyter.hascodecells && jupyter.ispythonornativeactive && !jupyter.havenativecells"
},
{
"command": "jupyter.runallcellsabove.palette",
"title": "%jupyter.command.jupyter.runallcellsabove.palette.title%",
"category": "Jupyter",
"when": "jupyter.hascodecells && jupyter.ispythonornativeactive"
"when": "jupyter.hascodecells && jupyter.ispythonornativeactive && !jupyter.havenativecells"
},
{
"command": "jupyter.debugcurrentcell.palette",
Expand Down

0 comments on commit 4d51730

Please sign in to comment.