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 bad boundary matches #188

Merged
merged 5 commits into from
Dec 17, 2017
Merged

Fix bad boundary matches #188

merged 5 commits into from
Dec 17, 2017

Conversation

jacktasia
Copy link
Owner

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.323% when pulling e6d55c3 on fix-bad-boundary-matches into 3d69721 on master.

1 similar comment
@coveralls
Copy link

coveralls commented Dec 15, 2017

Coverage Status

Coverage remained the same at 97.323% when pulling e6d55c3 on fix-bad-boundary-matches into 3d69721 on master.

@coveralls
Copy link

coveralls commented Dec 15, 2017

Coverage Status

Coverage remained the same at 97.323% when pulling 504ac7c on fix-bad-boundary-matches into 3d69721 on master.

dumb-jump.el Outdated

(:type "variable" :supports ("ag" "grep" "rg" "git-grep") :language "elisp"
:regex "\\\(setq\\b\\s*JJJ\\j" :tests ("(setq test 123)") :not ("setq test-blah 123)"))
:regex "\\\(setq\\b\\s*JJJ\\j" :tests ("(setq test 123)")
Copy link
Contributor

Choose a reason for hiding this comment

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

Like in the other places, it would be nice with a newline before :tests for readability.

@@ -125,25 +125,25 @@ or most optimal searcher."
:type 'string)

(defcustom dumb-jump-ag-word-boundary
"(?![\\w\\?\\*-])"
"(?![a-zA-Z0-9\\?\\*-])"
Copy link
Contributor

Choose a reason for hiding this comment

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

The motivation for using a-zA-Z0-9 instead of \w is that you don't want it to match for _ which is the only other character not matched by this change?

Copy link
Owner Author

Choose a reason for hiding this comment

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

For some searchers it was causing bad matches as outlined in #186 . For example, saying tester was a match when jumping on test. You can see evidence of this in the early commits for this PR with the ❌s, but here's a deep link to one example: https://travis-ci.org/jacktasia/dumb-jump/jobs/316563561
Thanks again for looking at this!

Copy link
Owner Author

Choose a reason for hiding this comment

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

This leads me to believe for these searchers with the options we give them \w is not recognized at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

Very weird but I see the point. Np :)

Copy link
Contributor

@netromdk netromdk left a comment

Choose a reason for hiding this comment

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

Looks good. I only have that thing about the substitution of \w.

Copy link
Contributor

@netromdk netromdk left a comment

Choose a reason for hiding this comment

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

I approve of these changes. You'll squash?

@jacktasia jacktasia merged commit 94275ba into master Dec 17, 2017
@jacktasia jacktasia deleted the fix-bad-boundary-matches branch December 17, 2017 19:55
@jacktasia
Copy link
Owner Author

@netromdk Yup, thanks!

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.

3 participants