aboutsummaryrefslogtreecommitdiffstats
path: root/copy.js
diff options
context:
space:
mode:
authorteramako2008-11-27 02:59:23 +0000
committerteramako2008-11-27 02:59:23 +0000
commit4eeecdf1d4f0ed70777bf99dc0b8c3b4108d27c5 (patch)
treeb55a64fa4da49f26f561e7a93c94abecd7ff82a6 /copy.js
parentbb060b02099af02c1531b4cc8a72063a62cabf63 (diff)
downloadvimperator-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
Diffstat (limited to 'copy.js')
-rw-r--r--copy.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/copy.js b/copy.js
index 48a8942..0934b38 100644
--- a/copy.js
+++ b/copy.js
@@ -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
}