fuzzy_url: handle invalid URLs with autosearch off

Fixes #497.
This commit is contained in:
Florian Bruhin 2015-02-02 22:23:18 +01:00
parent a95dda8e92
commit fba2b2b5ae

View File

@ -178,7 +178,11 @@ def fuzzy_url(urlstr, cwd=None, relative=False):
url = qurl_from_user_input(stripped)
log.url.debug("Converting fuzzy term {} to URL -> {}".format(
urlstr, url.toDisplayString()))
qtutils.ensure_valid(url)
if config.get('general', 'auto-search'):
qtutils.ensure_valid(url)
else:
if not url.isValid():
raise FuzzyUrlError("Invalid URL '{}'!".format(urlstr))
return url