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

Resolve bug in which filtering the inline bookmarks pane always fails #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daniel347x
Copy link

This code resolves the problem in which filtering the inline bookmarks pane always fails.

The cause was the filtering logic. When RegExp filters were present, they were being tested against branch nodes (i.e., the filenames), not just against the leaf nodes (i.e., the actual bookmark notes).

The current code resolves this by doing two things:

  • Only perform the RegExp check against leaf nodes, passing the branch nodes through

  • To eliminate branch nodes with no matching children, call the underlying data model instance for every passed node to see if any of its children match and in that case, do filter it out.

Regarding performance and correctness, in my tests, not provided here, I checked multiple bookmark types across multiple files and it worked without any glitches and very quickly for a moderate-sized workspace. With apologies, I do not have time to provide test cases for either accuracy or performance. However, the issue is resolved with this commit and the extension is now usable again.

This code resolves the problem in which filtering the inline bookmarks pane always fails.

The cause was the filtering logic. When RegExp filters were present, they were being tested against branch nodes (i.e., the filenames), not just against the leaf nodes (i.e., the actual bookmark notes).

The current code resolves this by doing two things:

- Only perform the RegExp check against leaf nodes, passing the branch nodes through

- To eliminate branch nodes with no matching children, call the underlying data model instance for every passed node to see if any of its children match and in that case, do filter it out.

Regarding performance and correctness, in my tests, not provided here, I checked multiple bookmark types across multiple files and it worked without any glitches and very quickly for a moderate-sized workspace. With apologies, I do not have time to provide test cases for either accuracy or performance. However, the issue is resolved with this commit and the extension is now usable again.
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.

1 participant