From 9ee8a5766461d55ac5bf3aa26ebf6bf12896d9a3 Mon Sep 17 00:00:00 2001 From: drry Date: Mon, 6 Oct 2008 22:48:03 +0000 Subject: * trivial fixes. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@20876 d0d07461-0603-4401-acd4-de1884942a52 --- lo.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'lo.js') diff --git a/lo.js b/lo.js index b98513a..182a279 100644 --- a/lo.js +++ b/lo.js @@ -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)]]; } } -- cgit v1.2.3