mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Added some comments to the Alt-Enter code part, and also added checking whether a new code cell is really needed.
This commit is contained in:
parent
a2665ef341
commit
eb47f0eb8d
@ -115,8 +115,12 @@ var IPython = (function (IPython) {
|
|||||||
that.execute_selected_cell();
|
that.execute_selected_cell();
|
||||||
return false;
|
return false;
|
||||||
} else if (event.which === key.ENTER && event.altKey) {
|
} else if (event.which === key.ENTER && event.altKey) {
|
||||||
|
// Execute code cell, and insert new in place
|
||||||
that.execute_selected_cell();
|
that.execute_selected_cell();
|
||||||
|
// Only insert a new cell, if we ended up in an already populated cell
|
||||||
|
if (that.get_selected_cell().toJSON().input !== "") {
|
||||||
that.insert_cell_above('code');
|
that.insert_cell_above('code');
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
} else if (event.which === key.ENTER && event.ctrlKey) {
|
} else if (event.which === key.ENTER && event.ctrlKey) {
|
||||||
that.execute_selected_cell({terminal:true});
|
that.execute_selected_cell({terminal:true});
|
||||||
|
Loading…
Reference in New Issue
Block a user