Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate completion in notebook #3594

Merged
merged 1 commit into from Jul 10, 2013
Merged

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Jul 10, 2013

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].

@Carreau
Copy link
Member Author

Carreau commented Jul 10, 2013

ping @takluyver

{ return true; }
}
for( var c in completion_array ) {
if(completion_array[c].replace(/^\s+|\s+$/g,'').substr(-item.length) == item)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick search suggests that we can .trim() instead of regexing it in all modern browsers.

@takluyver
Copy link
Member

Thanks - I don't have time to test at present, but I'll trust you that it does the job ;-)

@Carreau
Copy link
Member Author

Carreau commented Jul 10, 2013

A quick search suggests that we can .trim() instead of regexing it in all modern browsers.

Changed to trim() then.

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 ipython#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]`.
@minrk
Copy link
Member

minrk commented Jul 10, 2013

Works for me.

minrk added a commit that referenced this pull request Jul 10, 2013
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
@minrk minrk merged commit 1442128 into ipython:master Jul 10, 2013
@Carreau Carreau deleted the fixes-3563 branch November 26, 2013 21:09
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
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 ipython#3563
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate tab completions in the notebook
3 participants