##// END OF EJS Templates
select correct behavior for backspace in codecell
Matthias BUSSONNIER -
Show More
@@ -41,7 +41,7 var IPython = (function (IPython) {
41 41 mode: 'python',
42 42 theme: 'ipython',
43 43 readOnly: this.read_only,
44 extraKeys: {"Tab": "indentMore","Shift-Tab" : "indentLess"},
44 extraKeys: {"Tab": "indentMore","Shift-Tab" : "indentLess",'Backspace':"delSpaceToPrevTabStop"},
45 45 onKeyEvent: $.proxy(this.handle_codemirror_keyevent,this)
46 46 });
47 47 input.append(input_area);
@@ -125,20 +125,6 var IPython = (function (IPython) {
125 125 this.completer.startCompletion();
126 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 128 } else {
143 129 // keypress/keyup also trigger on TAB press, and we don't want to
144 130 // use those to disable tab completion.
General Comments 0
You need to be logged in to leave comments. Login now