Show More
@@ -11,7 +11,7 var IPython = (function (IPython) { | |||||
11 | // what is the common start of all completions |
|
11 | // what is the common start of all completions | |
12 |
|
12 | |||
13 |
|
13 | |||
14 |
function shared |
|
14 | function shared_start(B) { | |
15 | if (B.length == 1) { |
|
15 | if (B.length == 1) { | |
16 | return B[0]; |
|
16 | return B[0]; | |
17 | } |
|
17 | } | |
@@ -64,10 +64,10 var IPython = (function (IPython) { | |||||
64 | if (this.editor.somethingSelected()) return; |
|
64 | if (this.editor.somethingSelected()) return; | |
65 | this.done = false; |
|
65 | this.done = false; | |
66 | // use to get focus back on opera |
|
66 | // use to get focus back on opera | |
67 |
this.carry |
|
67 | this.carry_on_completion(true); | |
68 | }; |
|
68 | }; | |
69 |
|
69 | |||
70 |
Completer.prototype.carry |
|
70 | Completer.prototype.carry_on_completion = function (ff) { | |
71 | // Pass true as parameter if you want the commpleter to autopick when |
|
71 | // Pass true as parameter if you want the commpleter to autopick when | |
72 | // only one completion. This function is automatically reinvoked at |
|
72 | // only one completion. This function is automatically reinvoked at | |
73 | // each keystroke with ff = false |
|
73 | // each keystroke with ff = false | |
@@ -244,7 +244,7 var IPython = (function (IPython) { | |||||
244 | //Check that shared start is not null which can append with prefixed completion |
|
244 | //Check that shared start is not null which can append with prefixed completion | |
245 | // like %pylab , pylab have no shred start, and ff will result in py<tab><tab> |
|
245 | // like %pylab , pylab have no shred start, and ff will result in py<tab><tab> | |
246 | // to erase py |
|
246 | // to erase py | |
247 |
var sh = shared |
|
247 | var sh = shared_start(this.raw_result); | |
248 | if (sh) { |
|
248 | if (sh) { | |
249 | this.insert(sh); |
|
249 | this.insert(sh); | |
250 | } |
|
250 | } | |
@@ -253,7 +253,7 var IPython = (function (IPython) { | |||||
253 | this.editor.focus(); |
|
253 | this.editor.focus(); | |
254 | //reinvoke self |
|
254 | //reinvoke self | |
255 | setTimeout(function () { |
|
255 | setTimeout(function () { | |
256 |
that.carry |
|
256 | that.carry_on_completion(); | |
257 | }, 50); |
|
257 | }, 50); | |
258 | } else if (code == key.upArrow || code == key.downArrow) { |
|
258 | } else if (code == key.upArrow || code == key.downArrow) { | |
259 | // need to do that to be able to move the arrow |
|
259 | // need to do that to be able to move the arrow | |
@@ -264,7 +264,7 var IPython = (function (IPython) { | |||||
264 | this.editor.focus(); |
|
264 | this.editor.focus(); | |
265 | //we give focus to the editor immediately and call sell in 50 ms |
|
265 | //we give focus to the editor immediately and call sell in 50 ms | |
266 | setTimeout(function () { |
|
266 | setTimeout(function () { | |
267 |
that.carry |
|
267 | that.carry_on_completion(); | |
268 | }, 50); |
|
268 | }, 50); | |
269 | } |
|
269 | } | |
270 | } |
|
270 | } |
General Comments 0
You need to be logged in to leave comments.
Login now