Merge pull request #3594 from Carreau/fixes-3563

Fix duplicate completion in notebook

comparaison between kernel completion and context-completin were
returning duplicate entry in some cases, due to trailing space.
sripping trailing space in comparaison prevent this.

closes #3563
This commit is contained in:
Min RK 2013-07-10 10:18:59 -07:00
commit 2e417e82f0

View File

@ -15,10 +15,10 @@ var IPython = (function (IPython) {
}
function _existing_completion(item, completion_array){
for( var c in completion_array ) {
if(completion_array[c].substr(-item.length) == item)
{ return true; }
}
for( var c in completion_array ) {
if(completion_array[c].trim().substr(-item.length) == item)
{ return true; }
}
return false;
}