aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/completion.js2
-rw-r--r--lib/utils.js6
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/completion.js b/lib/completion.js
index cad7d455..75785c34 100644
--- a/lib/completion.js
+++ b/lib/completion.js
@@ -197,6 +197,8 @@ var completion = (function() {
var url;
var str;
+ // trim query
+ query = query.replace(/^\s+|\s+$/g, '');
if (utils.isUrl(query)) {
url = utils.createFullUrl(query);
str = '<em>goto</em> ' + url;
diff --git a/lib/utils.js b/lib/utils.js
index e23799d8..2b580786 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -56,12 +56,6 @@ var utils = {
// are there more?
var specialHostNames = [ 'localhost' ];
- // trim str
- str = str.replace(/^\s+|\s+$/g, '');
-
- if (str[0] === '/')
- return "file://" + str;
-
// it starts with a scheme, so it's definitely an URL
if (/^[a-z]{3,}:\/\//.test(str))
return true;