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

StopsMatching #10

Closed
charlesangus opened this issue Mar 21, 2014 · 5 comments
Closed

StopsMatching #10

charlesangus opened this issue Mar 21, 2014 · 5 comments

Comments

@charlesangus
Copy link

My TabTabTab has stopped finding matches.

Hitting tab brings up a list of nodes sorted by weight with a text box, as usual, but typing in the text box does nothing.

Deleting the weight file does not resolve the issue.

@charlesangus
Copy link
Author

Here is the error:

Traceback (most recent call last):
File "/site_repo/nuke7.0/python/tabtabtab.py", line 456, in update
self.things_model.set_filter(text)
File "/site_repo/nuke7.0/python/tabtabtab.py", line 222, in set_filter
self.update()
File "/site_repo/nuke7.0/python/tabtabtab.py", line 236, in update
if nonconsec_find(filtertext, uiname.lower(), anchored=True):
File "/site_repo/nuke7.0/python/tabtabtab.py", line 119, in nonconsec_find
if needle[0] != haystack[0]:
IndexError: list index out of range

@charlesangus
Copy link
Author

This seems to fix the problem.

Replacing this:

if anchored:
    if needle[0] != haystack[0]:
        return False
    else:
        # First letter matches, remove it for further matches
        needle = needle[1:]
        del haystack[0]

with this:

if anchored:
    if len(needle) == 0:
        return False
    if len(haystack) == 0:
        return False
    if needle[0] != haystack[0]:
        return False
    else:
        # First letter matches, remove it for further matches
        needle = needle[1:]
        del haystack[0]

@dbr
Copy link
Owner

dbr commented Mar 22, 2014

Woops, I had fixed this a while ago, but I forgot to release the changes - shall do that tonight, hopefully

That change is correct

@dbr
Copy link
Owner

dbr commented Mar 22, 2014

(although I think the haystack = haystack.rpartition(" [")[0] section needs to come first, in case you enter [ which causes haystack to be empty)

@dbr dbr closed this as completed in e3da9b7 Mar 22, 2014
@dbr
Copy link
Owner

dbr commented Mar 22, 2014

Fixed in newly released v1.7

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

No branches or pull requests

2 participants