From 08e277d071497e66364c39ec07b1e28cc8c93a58 Mon Sep 17 00:00:00 2001 From: pekepeke Date: Wed, 26 Nov 2008 15:07:02 +0000 Subject: 2.0pre補完対応 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24977 d0d07461-0603-4401-acd4-de1884942a52 --- ubiquity.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ubiquity.js') diff --git a/ubiquity.js b/ubiquity.js index 0ed8f84..ffdf75e 100644 --- a/ubiquity.js +++ b/ubiquity.js @@ -71,8 +71,8 @@ commands.addUserCommand(['ubi[quity]'], 'Vimperator Ubiquity Glue', } ubiquityManager.execute(args); }, { - completer: function(filter){ - return ubiquityManager.completer(filter); + completer: function(context, arg, special){ + ubiquityManager.completer(context, arg.string) } }, true @@ -108,14 +108,16 @@ var ubiquityManager = { liberator.echoerr(e); } }, - completer: function(args){ + completer: function(context, args){ var matches = args.match(/(\S+)(?:\s+(.+)$)?/); var suggestions = []; for (let cmd in this.commands){ suggestions.push([cmd, this.commands[cmd].description]); } + context.title = ['Command','Description']; if (!matches){ - return [0, suggestions]; + context.items = suggestions; + return; } var [cmd, arg] = [matches[1], matches[2]]; if (arg || (cmd && cmd in this.commands) ){ @@ -128,7 +130,8 @@ var ubiquityManager = { gUbiquity.__updatePreview(); } } else if (cmd){ - return [0, suggestions.filter(function(command){return command[0].indexOf(cmd) == 0;}) ]; + context.items = suggestions.filter(function(command){return command[0].indexOf(cmd) == 0;}); + return; } return [0, []]; }, -- cgit v1.2.3