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

'*' and '#' should search whole word #429

Closed
localvar opened this issue Jul 12, 2016 · 6 comments
Closed

'*' and '#' should search whole word #429

localvar opened this issue Jul 12, 2016 · 6 comments

Comments

@localvar
Copy link

localvar commented Jul 12, 2016

Do you need help or have a question? Ask us on Slack 👫.
Found a bug? Please fill out the sections below 👍.

Issue Summary

* and # not searching whole word

Steps to Reproduce

text as below

abc abcd abcde
  1. * on abc
  2. n will match abc in abcd and abcde

Technical details:

  • VSCode Version: 1.3.0
  • VsCodeVim Version: 0.1.1
  • OS: windows 10
@johnfn
Copy link
Member

johnfn commented Jul 12, 2016

Totally true. I was holding off on doing this until we could handle word delimiters in / and ?.

@octref
Copy link
Contributor

octref commented Jul 26, 2016

@johnfn
Hi Grant I'm interested in taking a shot at this. Do you mind elaborating on "handle word delimiters in / and ?" I can also try fixing that if it's not too complicated.

@johnfn
Copy link
Member

johnfn commented Jul 26, 2016

@octref awesome! absolutely!

In Vim, when you're searching with / or ?, you can actually use certain special delimiters to indicate you want to match a full word. For instance, / matches only the entire word foo, not foobar or barfoo.

If you use * and # in vim you can tell this is how they work under the hood.

So I would suggest to implement that for / and ?, then rewrite * and # to use / and ? rather than reimplement them.

@johnfn johnfn added this to the v0.2 milestone Jul 27, 2016
@jpoon
Copy link
Member

jpoon commented Aug 6, 2016

From #569, another issue with our current implementation.

   |          "package": hello, world

where | represents where the cursor is.

Expected: / or ? of <package>
Actual: Does nothing

@octref
Copy link
Contributor

octref commented Sep 2, 2016

@johnfn

Sorry for not responding for so long...

If you do :h pattern-multi-items and :h pattern-atoms, there is a whole slew of patterns. I feel it would be weird to implement some of them but not all. And implementing them all is no small task.

Personally, I mostly use / without any patterns, and some * and # sparingly.
A search on issues also yield no one asking for special patterns.

Maybe we should guide people to use VSCode's built-in Find by Regex, which is also standard Regex, not like Vim's special flavor.

@johnfn
Copy link
Member

johnfn commented Oct 1, 2016

This was actually finished a while back! :)

@johnfn johnfn closed this as completed Oct 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants