diff options
author | drry | 2008-10-06 22:48:03 +0000 |
---|---|---|
committer | drry | 2008-10-06 22:48:03 +0000 |
commit | 9ee8a5766461d55ac5bf3aa26ebf6bf12896d9a3 (patch) | |
tree | 0517430262162aedf45511381c2a71c10d0e701e | |
parent | 8c257d69c31a8a6034a459ab19e8b8f19c0e066b (diff) | |
download | vimperator-plugins-9ee8a5766461d55ac5bf3aa26ebf6bf12896d9a3.tar.bz2 |
* trivial fixes.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@20876 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | lo.js | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -47,18 +47,17 @@ function makeRegExp (str) { if (!migemo) return new RegExp(str, 'i'); - if (str.indexOf('/') == 0) { + if (str.indexOf('/') == 0) return new RegExp(str.slice(1), 'i'); - } else { + else return migemo.getRegExp(str); - } } function filteredLinks (word) { if (word.match(/^\s*$/)) - return []; // [it for each (it in content.document.links) if (it.href)]; + return []; // [it for each (it in content.document.links) if (it.href)]; let re = makeRegExp(word); - return [it for each (it in content.document.links) if (lmatch(re, it))]; + return [it for each (it in content.document.links) if (lmatch(re, it))]; } function charToWhere (str, fail) { @@ -104,7 +103,7 @@ completer: function (word) { let links = filteredLinks(word); return [0, [[it.href, it.textContent] for each (it in links)]]; - }, + } } ); @@ -132,15 +131,15 @@ if (lolinks[0]) { liberator.buffer.followLink(lolinks[0], where); } else { - liberator.echoerr('lol') + liberator.echoerr('lol'); } }, { - options: looptions; + options: looptions, completer: function (word) { let opts = liberator.parseArgs(word, looptions, "1", true); log(opts); - lolinks = filteredLinks(word);//word.match(/\bhttp[^\s]+/)); + lolinks = filteredLinks(word);//word.match(/\bhttp\S+/)); return [0, [[it.href, it.textContent] for each (it in lolinks)]]; } } |