diff options
author | pekepeke | 2008-11-26 15:07:02 +0000 |
---|---|---|
committer | pekepeke | 2008-11-26 15:07:02 +0000 |
commit | 08e277d071497e66364c39ec07b1e28cc8c93a58 (patch) | |
tree | f8989b0ea78ac4e0f0cdd3a936750f3e926c50be | |
parent | d6b875f602e3646109f54fd3461b516b1585afea (diff) | |
download | vimperator-plugins-08e277d071497e66364c39ec07b1e28cc8c93a58.tar.bz2 |
2.0pre補完対応
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24977 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | ubiquity.js | 13 |
1 files changed, 8 insertions, 5 deletions
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, []]; }, |