##// END OF EJS Templates
Improve special key handling in completer
Juergen Hasch -
Show More
@@ -255,6 +255,15 var IPython = (function (IPython) {
255 Completer.prototype.keydown = function (event) {
255 Completer.prototype.keydown = function (event) {
256 var code = event.keyCode;
256 var code = event.keyCode;
257 var that = this;
257 var that = this;
258 var special_key = false;
259
260 // detect special keys like SHIFT,PGUP,...
261 for( var _key in key ) {
262 if (code == key[_key] ) {
263 special_key = true;
264 }
265 };
266
258 // Enter
267 // Enter
259 if (code == key.ENTER) {
268 if (code == key.ENTER) {
260 CodeMirror.e_stop(event);
269 CodeMirror.e_stop(event);
@@ -288,7 +297,7 var IPython = (function (IPython) {
288 // need to do that to be able to move the arrow
297 // need to do that to be able to move the arrow
289 // when on the first or last line ofo a code cell
298 // when on the first or last line ofo a code cell
290 event.stopPropagation();
299 event.stopPropagation();
291 } else if (code != key.UPARROW && code != key.DOWNARROW) {
300 } else if (special_key != true) {
292 this.close();
301 this.close();
293 this.editor.focus();
302 this.editor.focus();
294 //we give focus to the editor immediately and call sell in 50 ms
303 //we give focus to the editor immediately and call sell in 50 ms
General Comments 0
You need to be logged in to leave comments. Login now