feat: Support multiple bangs in the same query#75
Conversation
|
Hi @Tyarel8, thanks for the PR! I'm having a pretty busy week, but will review and test it next week :) |
|
Hi @Tyarel8, I finally got a chance to review the PR. I think this is a useful feature. However, right now there seems to be a bug when setting the bang symbol to some character that might appear in a bang, e.g.,
In the first case, I actually had this feature noted down in my backlog, but I never got to implement it because it comes with some important caveats. For example, take the bang
Separating the multiple triggers by a space could solve this, e.g.:
However, we could now have false positives. E.g., if the bang symbol was
We could use more exotic syntax, like grouping the bang triggers within curly braces, e.g., |
|
You are right, I hadn't considered that non-symbol characters could be used for the trigger. Maybe the simples solution is to disallow characters that are in bangs for the triggers. Looking at kagi, here is the list of characters that are used: |
|
@Tyarel8 I wouldn't want to restrict the core functionality of Yang for this to work, there are a number of users who use letters in their bang triggers. Furthermore, this solution would be fragile: what if Kagi or DuckDuckGo added bangs with new characters? Do we keep limiting the allowed symbols with every release? You can imagine how frustrating that would be for users... For now, the only solution I see is:
Also, we need to keep in mind that bang triggers can go at the beginning or at the end of the query. I guess now with this feature they could also go in both sides? |
Basically, it occurred to me that custom bangs already support multiple targets, so it would be cool to be able to do it without creating a custom bang first.
I made it possible to do
!g!ddg!wto open google, duckduckgo, wikipedia, etc. Everything else should be working the same, I have tested myself that it works but I could've missed something. Feel free to reject the pull request if it breaks something or it's badly implemented.