Show
Ignore:
Timestamp:
11/27/08 11:59:23 (6 weeks ago)
Author:
teramako
Message:

follow CVS HEAD (fix: command argument and completer)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/copy.js

    r24976 r25054  
    8080//const defaultValue = templates[0].label; 
    8181commands.addUserCommand(['copy'],'Copy to clipboard', 
    82     function(args, special){ 
    83         liberator.plugins.exCopy.copy(args.string, special); 
     82    function(args){ 
     83        liberator.plugins.exCopy.copy(args.string, args.bang); 
    8484    },{ 
    85         completer: function(context, arg, special){ 
    86             if (special){ 
     85        completer: function(context, args){ 
     86            if (args.bang){ 
    8787                completion.javascript(context); 
    8888                return; 
     
    9494            if (!context.filter){ context.completions = templates; return; } 
    9595            var candidates = []; 
    96             context.completions = completion.filter(templates, context.filter, true); 
     96            var filter = context.filter.toLowerCase(); 
     97            templates.forEach(function(template){ 
     98                if (template[0].toLowerCase().indexOf(filter) == 0) 
     99                    candidates.push(template); 
     100            }); 
     101            context.completions = candidates; 
    97102        }, 
    98103        bang: true