don't need to check for leading dot

This commit is contained in:
Matthias BUSSONNIER 2012-06-05 09:26:21 +02:00
parent 795cb7bb21
commit 567b6bbcd2

View File

@ -8,18 +8,15 @@ var IPython = (function (IPython) {
// easyier key mapping
var key = IPython.utils.keycodes;
// what is the common start of all completions
function _existing_completion(item, completion_array){
if(item.substr(0,1) == '.') {
for( var c in completion_array ) {
if(completion_array[c].substr(-item.length) == item)
{ return true; }
}
return false;
}
else {return completion_array.indexOf(item) != -1}
for( var c in completion_array ) {
if(completion_array[c].substr(-item.length) == item)
{ return true; }
}
return false;
}
// what is the common start of all completions
function shared_start(B) {
if (B.length == 1) {
return B[0];
@ -129,7 +126,7 @@ var IPython = (function (IPython) {
//remove results from context completion
//that are already in kernel completion
for(var elm in results) {
if(_existing_completion(results[elm]['str'],matches) == false)
if(_existing_completion(results[elm]['str'], matches) == false)
{ filterd_results.push(results[elm]); }
}