##// END OF EJS Templates
select correct behavior for backspace in codecell
Matthias BUSSONNIER -
Show More
@@ -41,7 +41,7 b' var IPython = (function (IPython) {'
41 mode: 'python',
41 mode: 'python',
42 theme: 'ipython',
42 theme: 'ipython',
43 readOnly: this.read_only,
43 readOnly: this.read_only,
44 extraKeys: {"Tab": "indentMore","Shift-Tab" : "indentLess"},
44 extraKeys: {"Tab": "indentMore","Shift-Tab" : "indentLess",'Backspace':"delSpaceToPrevTabStop"},
45 onKeyEvent: $.proxy(this.handle_codemirror_keyevent,this)
45 onKeyEvent: $.proxy(this.handle_codemirror_keyevent,this)
46 });
46 });
47 input.append(input_area);
47 input.append(input_area);
@@ -125,20 +125,6 b' var IPython = (function (IPython) {'
125 this.completer.startCompletion();
125 this.completer.startCompletion();
126 return true;
126 return true;
127 };
127 };
128 } else if (event.keyCode === key.BACKSPACE && event.type == 'keydown') {
129 // If backspace and the line ends with 4 spaces, remove them.
130 var line = editor.getLine(cur.line);
131 var ending = line.slice(-4);
132 if (ending === ' ') {
133 editor.replaceRange('',
134 {line: cur.line, ch: cur.ch-4},
135 {line: cur.line, ch: cur.ch}
136 );
137 event.stop();
138 return true;
139 } else {
140 return false;
141 };
142 } else {
128 } else {
143 // keypress/keyup also trigger on TAB press, and we don't want to
129 // keypress/keyup also trigger on TAB press, and we don't want to
144 // use those to disable tab completion.
130 // use those to disable tab completion.
General Comments 0
You need to be logged in to leave comments. Login now