Spoons
Spoons copied to clipboard
Seal UserActions url does not substitute query
When using Seal UserActions plugin with custom URL, the search term is never properly substituted. Instead, the query is always ${query}
.
Here is my config, but I also tested by copying the Leo translate example from the docs and saw the same behavior.
["Google Search"] = {
url = "https://www.google.com/search?q=${query}",
icon = "favicon",
keyword = "g",
},
Strangely, when I experiment with including symbols in the query sometimes it works.
For example:
- The command
g hello
fails and openshttps://www.google.com/search?q=$%7Bquery%7D
- The command
g hello%
successfully openshttps://www.google.com/search?q=hello%25
.
I was able to get it working by making this change on line 279 of seal_useractions.lua:
local query_escaped = row.arg:gsub("%%", "%%%%")
local url = string.gsub(obj.actions[row.actionname].url, "${query}", query_escaped)
Very weird... I'm pretty stumped why this would fix it but it does. Maybe it's an issue with Lua?
Would you like me to open a PR?
I was having the same issue, the fix @ameddin73's fix worked for me.
There's a PR already: #272 No reaction yet, maybe we could boost this a little.