1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-29 13:35:46 +01:00

Replace weird mystery meat args of mapping actions with a proper object.

This commit is contained in:
Kris Maglione
2010-12-29 22:21:00 -05:00
parent f67a50147e
commit cb97f1cd25
12 changed files with 87 additions and 98 deletions

View File

@@ -105,18 +105,10 @@ var Map = Class("Map", {
* mapping. E.g. "a" for "ma"
*/
execute: function (motion, count, argument, command) {
let args = [];
if (this.motion)
args.push(motion);
if (this.count)
args.push(count);
if (this.arg)
args.push(argument);
args.push(command);
let args = { count: count, arg: argument, motion: motion, command: command };
let self = this;
function repeat() self.action.apply(self, args);
function repeat() self.action(args)
if (this.names[0] != ".") // FIXME: Kludge.
mappings.repeat = repeat;
@@ -374,7 +366,7 @@ var Mappings = Module("mappings", {
else {
mappings.addUserMap(mapmodes, [lhs],
args["-description"],
Command.bindMacro(args, "-keys", ["count"]),
Command.bindMacro(args, "-keys", function (params) params),
{
count: args["-count"],
noremap: args["-builtin"],