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

Typing a dash (-) breaks the search #8

Open
KKSzymanowski opened this issue Apr 2, 2019 · 2 comments
Open

Typing a dash (-) breaks the search #8

KKSzymanowski opened this issue Apr 2, 2019 · 2 comments

Comments

@KKSzymanowski
Copy link

KKSzymanowski commented Apr 2, 2019

I have a project with a dash in it's name:
image
If I add the dash to the search query, the result disappears:
image

I'm using a similar workflow for PhpStorm and it works there:
image

@KKSzymanowski
Copy link
Author

Changing this line

  def _splitMatchWords(self, title):
    res = []
    cam = self._camel_case_split(title)
    for m in cam:
      ret = re.split('-|_| |',m)
      for n in ret:
        res.append(n)
-     return ' '.join(res);
+     return ' '.join(res) + ' ' + title;

seems to fix it.

This just adds the whole title to the list of words in the match field. You can do some fancy stuff to for example only add the whole title if the res array has more than one element(which means it has actually been split) but what I proposed might be just enough.
Should I create a Pull Request?

@KKSzymanowski
Copy link
Author

Or even better:

  def _splitMatchWords(self, title):
-   res = []
+   res = [title]
    cam = self._camel_case_split(title)
    for m in cam:
      ret = re.split('-|_| |',m)
      for n in ret:
        res.append(n)
    return ' '.join(res);

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 a pull request may close this issue.

1 participant