diff options
author | anekos | 2008-11-23 00:35:01 +0000 |
---|---|---|
committer | anekos | 2008-11-23 00:35:01 +0000 |
commit | 00b1f584a13c4cae8b0b84b6e3ffc67f7b9d037b (patch) | |
tree | 0030344502fe3b267f13964659ad43160629ae9a /command_menu.js | |
parent | c9148677771aa64b1169866b9631a2b5946ca79e (diff) | |
download | vimperator-plugins-00b1f584a13c4cae8b0b84b6e3ffc67f7b9d037b.tar.bz2 |
follow the new completer.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24676 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'command_menu.js')
-rw-r--r-- | command_menu.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/command_menu.js b/command_menu.js index 4cabb55..8f72850 100644 --- a/command_menu.js +++ b/command_menu.js @@ -146,21 +146,19 @@ commands.addUserCommand( cmds, name, - function (args, _, num, extra) { - // for HEAD (2) - if (args.string != undefined) - args = args.string; - var res = _find(args.replace(/-\s*$/,''), true); + function (arg) { + var res = _find(arg.string.replace(/-\s*$/,''), true); if (!(res && action(res))) liberator.echoerr('menu not found'); }, { - completer: function (args) { + completer: function (context, arg, bang) { const gps = function (it) getPathString(it, equal(root), getElementName, isClickable); const fp = function (it) [gps(it), it.tooltipText || '']; - return [0, _find(args).map(fp)]; + return [0, _find(context.filter).map(fp)]; } - } + }, + true ); } |