mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
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. fixes #3563 example import bar from foo im<tab> used to propose `import` twice (actually `import` and `import[space]` as$ `import` was a token on the first line) now just complete directly to$ `import[space]`.
This commit is contained in:
parent
f0db998d4d
commit
1e75582e48
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user