drgrib / alfred-bear

Streamlined note searching and creation for Bear using Alfred
MIT License
427 stars 24 forks source link

Fix search for multi word tag #40

Closed duqcyxwd closed 1 year ago

duqcyxwd commented 3 years ago

Hi,

Thank you so much for creating this repo and it has almost everything I need for Bear!

One more thing I want is able to search with multi word tags and that is why I create this MR. It is using regex fetch to get tags. Another good way is writing a language parser to deal with this problem. I know using regex is a little bit hacky but it works.

This is my first day writing things with go and I will just stop here.

2021-03-25-alfred4

drgrib commented 3 years ago

Thanks for taking the time to work on this. One question I have is whether this will work with multi-word tags that have 3 or more words. Please add a test for that in the unit tests and ensure it works. If we are going to advertise this feature, we want to ensure it works for all multi-word tags.

For the record, I don't think that using regexp is "hacky". It's part of the standard library and I use it in production code all the time. It is the best way to solve most parsing problems like this one.

drgrib commented 1 year ago

Implemented in #60