Alfred_SourceTree
Alfred_SourceTree copied to clipboard
Typing a dash (-) breaks the search
I have a project with a dash in it's name:
If I add the dash to the search query, the result disappears:
I'm using a similar workflow for PhpStorm and it works there:
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?
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);