mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 21:47:59 +01:00
allow {count}, and other flags, to be passed to e user mapping's action
This commit is contained in:
@@ -531,15 +531,17 @@ function Commands() //{{{
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// NOTE: we currently only allow one normal mode command in {rhs}
|
||||||
var map = vimperator.mappings.get(vimperator.modes.NORMAL, rhs);
|
var map = vimperator.mappings.get(vimperator.modes.NORMAL, rhs);
|
||||||
|
|
||||||
// create a new Map for {lhs} with the same action as
|
// create a new Map for {lhs} with the same action as
|
||||||
// {rhs}...until we have feedkeys().
|
// {rhs}...until we have feedkeys().
|
||||||
// NOTE: Currently only really useful for static use ie. from
|
// NOTE: Currently only really intended for static use (e.g.
|
||||||
// the RC file
|
// from the RC file) since {rhs} is evaluated when the map
|
||||||
|
// is created not at runtime
|
||||||
if (map)
|
if (map)
|
||||||
vimperator.mappings.add(
|
vimperator.mappings.add(
|
||||||
new Map(vimperator.modes.NORMAL, [lhs], map.action, { rhs: rhs })
|
new Map(vimperator.modes.NORMAL, [lhs], map.action, { flags: map.flags, rhs: rhs })
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
vimperator.echoerr("E475: Invalid argument: " + "{rhs} must be a existing singular mapping");
|
vimperator.echoerr("E475: Invalid argument: " + "{rhs} must be a existing singular mapping");
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ function Map(mode, cmds, action, extra_info) //{{{
|
|||||||
this.cancel_mode = extra_info.cancel_mode || false;
|
this.cancel_mode = extra_info.cancel_mode || false;
|
||||||
this.always_active = extra_info.always_active || false;
|
this.always_active = extra_info.always_active || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map.prototype.hasName = function(name)
|
Map.prototype.hasName = function(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user