diff options
author | anekos | 2009-02-08 07:16:28 +0000 |
---|---|---|
committer | anekos | 2009-02-08 07:16:28 +0000 |
commit | 064f6d611b756bc952ab35d5fce0fab837bbcce6 (patch) | |
tree | 85ebfc66503909959d5dfbc8076671ad17fa375f /cpan-search.js | |
parent | d4d05132483717d2814b6097a463bb10ed29c55b (diff) | |
download | vimperator-plugins-064f6d611b756bc952ab35d5fce0fab837bbcce6.tar.bz2 |
行末の空白を削除したり
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@29698 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'cpan-search.js')
-rw-r--r-- | cpan-search.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpan-search.js b/cpan-search.js index f664904..fed9353 100644 --- a/cpan-search.js +++ b/cpan-search.js @@ -31,7 +31,7 @@ if (!liberator.globalVariables.cpanListCache) { xhr.onreadystatechange = function() { if (xhr.readyState == 4) { if (xhr.status == 200) { - liberator.globalVariables.cpanListCache = + liberator.globalVariables.cpanListCache = xhr.responseText.split(/\r?\n/).map(function(i) [i, '', i.toUpperCase()]); } else { liberator.echoerr('CPAN Search: XHR Error: ' + xhr.statusText); @@ -45,7 +45,7 @@ if (!liberator.globalVariables.cpanListCache) { commands.addUserCommand( ['cpan'], - 'CPAN Search', + 'CPAN Search', function(args) { var name = (args.string || '').replace(/\s/g, '').replace(/^\^/,''); var url = 'http://search.cpan.org/perldoc?' + name; @@ -57,9 +57,9 @@ commands.addUserCommand( if (word.indexOf(':') >= 0) { var regex = word.split(/:+/).map(function(i) i + '[^:]*').join('::'); regex = new RegExp('^' + regex.replace(/\[\^:\]\*$/, '')); - context.filters = [function (item) regex.test(item.item[2])]; + context.filters = [function(item) regex.test(item.item[2])]; } else { - context.filters = [function (item) item.item[2].indexOf(word) != -1]; + context.filters = [function(item) item.item[2].indexOf(word) != -1]; } context.completions = liberator.globalVariables.cpanListCache || []; }, |