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

Seal doesn't allow you to search multiple word queries with urlformats #2258

Open
kevinforrestconnors opened this issue Dec 17, 2019 · 0 comments

Comments

@kevinforrestconnors
Copy link

To fix this, change the function choicesURLPart to replace spaces with +, which should work for most search systems. At the very least, it won't break the program like the current behavior

    function obj.choicesURLPart(query)
        --print("choicesURLPart for: "..query)
++
++      query = query:gsub(" ", "+")
++
        local choices = {}
        for name,data in pairs(obj.providers) do
            local data_url = data["url"]:gsub("([^%%])%%([^s])", "%1%%%%%2")
            local full_url = string.format(data_url, query)
            local url_scheme = string.sub(full_url, 1, string.find(full_url, "://") - 1)
            local choice = {}
            choice["text"] = data["name"]
            choice["subText"] = full_url
            choice["plugin"] = obj.__name
            choice["type"] = "launch"
            choice["url"] = full_url
            choice["scheme"] = url_scheme
            table.insert(choices, choice)
        end
        return choices
    end
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

No branches or pull requests

1 participant