diff --git a/IPython/frontend/html/notebook/static/js/cell.js b/IPython/frontend/html/notebook/static/js/cell.js index d48c071..df0e2ce 100644 --- a/IPython/frontend/html/notebook/static/js/cell.js +++ b/IPython/frontend/html/notebook/static/js/cell.js @@ -10,9 +10,10 @@ var IPython = (function (IPython) { var Cell = function (notebook) { this.notebook = notebook; this.selected = false; - this.element; + this.element = null; this.create_element(); - if (this.element !== undefined) { + if (this.element !== null) { + this.set_autoindent(true); this.element.data("cell", this); this.bind_events(); } diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index 1ffc292..3a6ce2d 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -27,8 +27,6 @@ var IPython = (function (IPython) { var input_area = $('
').addClass('input_area box-flex1'); this.code_mirror = CodeMirror(input_area.get(0), { indentUnit : 4, - enterMode : 'flat', - tabMode: 'shift', mode: 'python', theme: 'ipython', onKeyEvent: $.proxy(this.handle_codemirror_keyevent,this) @@ -64,7 +62,8 @@ var IPython = (function (IPython) { IPython.notebook.complete_cell(this, line, cur.ch); return true; } - } else if (event.keyCode === 8) { + } else if (event.keyCode === 8 && event.type == 'keydown') { + console.log(event); // If backspace and the line ends with 4 spaces, remove them. var cur = editor.getCursor(); var line = editor.getLine(cur.line); diff --git a/IPython/frontend/html/notebook/static/js/textcell.js b/IPython/frontend/html/notebook/static/js/textcell.js index a86ab86..9354468 100644 --- a/IPython/frontend/html/notebook/static/js/textcell.js +++ b/IPython/frontend/html/notebook/static/js/textcell.js @@ -24,8 +24,6 @@ var IPython = (function (IPython) { var input_area = $('').addClass('text_cell_input'); this.code_mirror = CodeMirror(input_area.get(0), { indentUnit : 4, - enterMode : 'flat', - tabMode: 'shift', mode: this.code_mirror_mode, theme: 'default', value: this.placeholder diff --git a/IPython/frontend/html/notebook/templates/notebook.html b/IPython/frontend/html/notebook/templates/notebook.html index 17a35c3..e7a71ab 100644 --- a/IPython/frontend/html/notebook/templates/notebook.html +++ b/IPython/frontend/html/notebook/templates/notebook.html @@ -121,7 +121,7 @@