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

consistent search behavior - '%s' format vs append #475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

faizk
Copy link

@faizk faizk commented Aug 29, 2016

The following should result in the same search url, but they don't:

open DEFAULTENGINE needle
open? needle
open needle

If DEFAULTENGINE is configured as

let searchengine myengine = "http://my.engi.ne/search?q=%s"
let defaultengine = "myengine"

Then the 3 open commands result in:

http://my.engi.ne/search?q=needle # OK
http://my.engi.ne/search?q=%sneedle # ?
http://my.engi.ne/search?q=%sneedle # ?

This fix makes the behavior consistent regardless of whether or not the
search engine to use is explicit; from README.md -

If you leave out the '%s' at the end of the URL,
your query will be appended to the link.
Otherwise, your query will replace the '%s'.

The following should result in the same search url, but they don't:

open DEFAULTENGINE needle
open? needle
open needle

If DEFAULTENGINE is configured as

let searchengine myengine = "http://my.engi.ne/search?q=%s"
let defaultengine = "myengine"

Then the 3 open commands result in:

http://my.engi.ne/search?q=needle  # OK
http://my.engi.ne/search?q=%sneedle  # ?
http://my.engi.ne/search?q=%sneedle  # ?

This fix makes the behavior consistent regardless of whether or not the
search engine to use is explicit; from README.md -

> If you leave out the '%s' at the end of the URL,
> your query will be appended to the link.
> Otherwise, your query will replace the '%s'.
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

Successfully merging this pull request may close these issues.

1 participant