From 1cae7230d914b43e55dbe0d63fc7c348b43626a8 Mon Sep 17 00:00:00 2001 From: Brian Granger Date: Tue, 3 May 2011 15:30:59 -0700 Subject: [PATCH] Shift-Enter only selects the next cell if it is a CodeCell. --- IPython/frontend/html/notebook/static/js/notebook.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js index fd9d0194c..a01bf6642 100644 --- a/IPython/frontend/html/notebook/static/js/notebook.js +++ b/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) {