1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 00:17:58 +01:00

use vimperator.events.feedkeys() for :map

This commit is contained in:
Doug Kearns
2007-08-15 17:21:49 +00:00
parent 42e295a718
commit 5470a9b5f9

View File

@@ -623,29 +623,9 @@ function Commands() //{{{
if (rhs)
{
if (/^:/.test(rhs))
{
vimperator.mappings.add(
new Map(vimperator.modes.NORMAL, [lhs], function() { vimperator.execute(rhs); }, { rhs: rhs })
);
}
else
{
// NOTE: we currently only allow one normal mode command in {rhs}
var map = vimperator.mappings.get(vimperator.modes.NORMAL, rhs);
// create a new Map for {lhs} with the same action as
// {rhs}...until we have feedkeys().
// NOTE: Currently only really intended for static use (e.g.
// from the RC file) since {rhs} is evaluated when the map
// is created not at runtime
if (map)
vimperator.mappings.add(
new Map(vimperator.modes.NORMAL, [lhs], map.action, { flags: map.flags, rhs: rhs })
);
else
vimperator.echoerr("E475: Invalid argument: " + "{rhs} must be a existing singular mapping");
}
vimperator.mappings.add(new Map(vimperator.modes.NORMAL, [lhs],
function() { vimperator.events.feedkeys(rhs); }, { rhs: rhs }
));
}
else
{