diff options
author | teramako | 2008-11-27 02:59:23 +0000 |
---|---|---|
committer | teramako | 2008-11-27 02:59:23 +0000 |
commit | 4eeecdf1d4f0ed70777bf99dc0b8c3b4108d27c5 (patch) | |
tree | b55a64fa4da49f26f561e7a93c94abecd7ff82a6 | |
parent | bb060b02099af02c1531b4cc8a72063a62cabf63 (diff) | |
download | vimperator-plugins-4eeecdf1d4f0ed70777bf99dc0b8c3b4108d27c5.tar.bz2 |
follow CVS HEAD (fix: command argument and completer)
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25054 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | copy.js | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -79,11 +79,11 @@ liberator.globalVariables.copy_templates.forEach(function(template){ // used when argument is none //const defaultValue = templates[0].label; commands.addUserCommand(['copy'],'Copy to clipboard', - function(args, special){ - liberator.plugins.exCopy.copy(args.string, special); + function(args){ + liberator.plugins.exCopy.copy(args.string, args.bang); },{ - completer: function(context, arg, special){ - if (special){ + completer: function(context, args){ + if (args.bang){ completion.javascript(context); return; } @@ -93,7 +93,12 @@ commands.addUserCommand(['copy'],'Copy to clipboard', ); if (!context.filter){ context.completions = templates; return; } var candidates = []; - context.completions = completion.filter(templates, context.filter, true); + var filter = context.filter.toLowerCase(); + templates.forEach(function(template){ + if (template[0].toLowerCase().indexOf(filter) == 0) + candidates.push(template); + }); + context.completions = candidates; }, bang: true } |