##// END OF EJS Templates
Autoindentation fixed and enabled by default.
Brian E. Granger -
Show More
@@ -10,9 +10,10 b' var IPython = (function (IPython) {'
10 10 var Cell = function (notebook) {
11 11 this.notebook = notebook;
12 12 this.selected = false;
13 this.element;
13 this.element = null;
14 14 this.create_element();
15 if (this.element !== undefined) {
15 if (this.element !== null) {
16 this.set_autoindent(true);
16 17 this.element.data("cell", this);
17 18 this.bind_events();
18 19 }
@@ -27,8 +27,6 b' var IPython = (function (IPython) {'
27 27 var input_area = $('<div/>').addClass('input_area box-flex1');
28 28 this.code_mirror = CodeMirror(input_area.get(0), {
29 29 indentUnit : 4,
30 enterMode : 'flat',
31 tabMode: 'shift',
32 30 mode: 'python',
33 31 theme: 'ipython',
34 32 onKeyEvent: $.proxy(this.handle_codemirror_keyevent,this)
@@ -64,7 +62,8 b' var IPython = (function (IPython) {'
64 62 IPython.notebook.complete_cell(this, line, cur.ch);
65 63 return true;
66 64 }
67 } else if (event.keyCode === 8) {
65 } else if (event.keyCode === 8 && event.type == 'keydown') {
66 console.log(event);
68 67 // If backspace and the line ends with 4 spaces, remove them.
69 68 var cur = editor.getCursor();
70 69 var line = editor.getLine(cur.line);
@@ -24,8 +24,6 b' var IPython = (function (IPython) {'
24 24 var input_area = $('<div/>').addClass('text_cell_input');
25 25 this.code_mirror = CodeMirror(input_area.get(0), {
26 26 indentUnit : 4,
27 enterMode : 'flat',
28 tabMode: 'shift',
29 27 mode: this.code_mirror_mode,
30 28 theme: 'default',
31 29 value: this.placeholder
@@ -121,7 +121,7 b''
121 121 </div>
122 122 <div class="section_row">
123 123 <span id="autoindent_span">
124 <input type="checkbox" id="autoindent"></input>
124 <input type="checkbox" id="autoindent" checked="true"></input>
125 125 </span>
126 126 <span class="checkbox_label">Autoindent:</span>
127 127 </div>
General Comments 0
You need to be logged in to leave comments. Login now