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

no need to check for multiple mappings names, since they dont exist. so..

This commit is contained in:
Marco Candrian
2008-01-15 15:53:48 +00:00
parent 87ed1091aa
commit 40cc702d48
2 changed files with 5 additions and 4 deletions

View File

@@ -1620,7 +1620,7 @@ vimperator.Commands = function () //{{{
[[vimperator.modes.INSERT, vimperator.modes.TEXTAREA], "i"]]; [[vimperator.modes.INSERT, vimperator.modes.TEXTAREA], "i"]];
for (var y = 0; y < mode.length; y++) for (var y = 0; y < mode.length; y++)
{ {
// names.length is about always 1 on user maps. if not, iterate here and 'fix' getUserIterator... // NOTE: names.length is always 1 on user maps. If that changes, also fix getUserIterator and v.m.list
for (var map in vimperator.mappings.getUserIterator(mode[y][0])) for (var map in vimperator.mappings.getUserIterator(mode[y][0]))
line += mode[y][1] + (map.noremap ? "nore" : "") + "map " + map.names[0] + " " + map.rhs + "\n"; line += mode[y][1] + (map.noremap ? "nore" : "") + "map " + map.names[0] + " " + map.rhs + "\n";
} }

View File

@@ -161,7 +161,8 @@ vimperator.Mappings = function () //{{{
output = false; // toggle false, only true whan also found in this mode output = false; // toggle false, only true whan also found in this mode
for (var z = 0; z < user[modes[index]].length; z++) // maps for (var z = 0; z < user[modes[index]].length; z++) // maps
{ {
// FIXME: when other than user maps, there might be more than one names[]? Not used so far it seems... // NOTE: when other than user maps, there might be more than only one names[x].
// since only user mappings gets queried here, only names[0] gets checked for equality.
if (maps[i].rhs == user[modes[index]][z].rhs && maps[i].names[0] == user[modes[index]][z].names[0]) if (maps[i].rhs == user[modes[index]][z].rhs && maps[i].names[0] == user[modes[index]][z].names[0])
{ {
output = true; output = true;
@@ -277,7 +278,6 @@ vimperator.Mappings = function () //{{{
{ {
// modes means, a map must exist in both modes in order to get listed // modes means, a map must exist in both modes in order to get listed
var maps = user[modes[0]]; // duplicate (reference) (first mode where it must match) var maps = user[modes[0]]; // duplicate (reference) (first mode where it must match)
var output = []; var output = [];
@@ -300,7 +300,8 @@ vimperator.Mappings = function () //{{{
output[output.length - 1] = false; // toggle false, only true whan also found in this mode output[output.length - 1] = false; // toggle false, only true whan also found in this mode
for (var z = 0; z < user[modes[index]].length; z++) // maps on the other modes for (var z = 0; z < user[modes[index]].length; z++) // maps on the other modes
{ {
// XXX: on user maps, names.length is always 1? (per mode, and names = user-keybinding or so) // NOTE: when other than user maps, there might be more than only one names[x].
// since only user mappings gets queried here, only names[0] gets checked for equality.
if (maps[i].rhs == user[modes[index]][z].rhs && maps[i].names[0] == user[modes[index]][z].names[0]) if (maps[i].rhs == user[modes[index]][z].rhs && maps[i].names[0] == user[modes[index]][z].names[0])
{ {
output[output.length - 1] = true; output[output.length - 1] = true;