mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
don't need to check for leading dot
This commit is contained in:
parent
795cb7bb21
commit
567b6bbcd2
@ -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]); }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user