Permalink
Browse files

Shift-Enter only selects the next cell if it is a CodeCell.

  • Loading branch information...
ellisonbg committed May 3, 2011
1 parent e6b3e5b commit e341cf44b595c83d6e2b9ddb7f668d6b0ba5f030
Showing with 6 additions and 1 deletion.
  1. +6 −1 IPython/frontend/html/notebook/static/js/notebook.js
@@ -123,7 +123,12 @@ Notebook.prototype.bind_events = function () {
if (cell_index === (that.ncells()-1)) {
that.insert_code_cell_after();
} else {
- that.select(cell_index+1);
+ // Select the next cell if it is a CodeCell, but not
+ // if it is a TextCell.
+ var next_cell = that.cells()[cell_index+1];
+ if (!(next_cell instanceof TextCell)) {
+ that.select(cell_index+1);
+ };
};
}
} else if (event.which == 9) {

0 comments on commit e341cf4

Please sign in to comment.