From 00b1f584a13c4cae8b0b84b6e3ffc67f7b9d037b Mon Sep 17 00:00:00 2001 From: anekos Date: Sun, 23 Nov 2008 00:35:01 +0000 Subject: follow the new completer. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24676 d0d07461-0603-4401-acd4-de1884942a52 --- command_menu.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'command_menu.js') 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 ); } -- cgit v1.2.3