diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 15f63d00..7c5da97c 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -603,7 +603,7 @@ function Commands() //{{{ if (rhs) { - vimperator.mappings.add(new Map(vimperator.modes.NORMAL, [lhs], + vimperator.mappings.add(new Map([vimperator.modes.NORMAL], [lhs], function() { vimperator.events.feedkeys(rhs); }, { rhs: rhs } )); } @@ -730,7 +730,7 @@ function Commands() //{{{ if (/^:/.test(rhs)) { vimperator.mappings.add( - new Map(vimperator.modes.NORMAL, [lhs], function() { vimperator.execute(rhs); }, { rhs: rhs }) + new Map([vimperator.modes.NORMAL], [lhs], function() { vimperator.execute(rhs); }, { rhs: rhs }) ); } else @@ -745,7 +745,7 @@ function Commands() //{{{ // is created not at runtime if (map) vimperator.mappings.add( - new Map(vimperator.modes.NORMAL, [lhs], map.action, { flags: map.flags, rhs: rhs }) + 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"); diff --git a/chrome/content/vimperator/mappings.js b/chrome/content/vimperator/mappings.js index df15e2c6..a4f353a7 100644 --- a/chrome/content/vimperator/mappings.js +++ b/chrome/content/vimperator/mappings.js @@ -212,10 +212,11 @@ function Mappings() //{{{ for (var i = 0; i < map.names.length; i++) { for (var j = 0; j < map.modes.length; j++) - removeMap(map.modes[0], map.names[i]); + removeMap(map.modes[j], map.names[i]); } - user[map.mode].push(map); + for (var k = 0; k < map.modes.length; k++) + user[map.modes[k]].push(map); } this.remove = function(mode, cmd)