diff --git a/content/commands.js b/content/commands.js
index c1d63d20..80491d16 100644
--- a/content/commands.js
+++ b/content/commands.js
@@ -1436,7 +1436,7 @@ vimperator.Commands = function () //{{{
"list/remove autocommands matching {pat}
" +
":autocmd[!]
" +
"list/remove all autocommands",
- completer: function (filter) { return vimperator.completion.autocommands(filter); } //TODO: improve
+ completer: function (filter) { return vimperator.completion.autocommands(filter); }
}
));
// 0 args -> list all maps
@@ -1616,7 +1616,6 @@ vimperator.Commands = function () //{{{
var line = "\" " + vimperator.version + "\n";
line += "\" Mappings\n";
- // TODO: write user maps for all modes when we have mode dependant map support
var mode = [[[vimperator.modes.NORMAL], ""], [[vimperator.modes.COMMAND_LINE], "c"],
[[vimperator.modes.INSERT, vimperator.modes.TEXTAREA], "i"]];
for (var y = 0; y < mode.length; y++)
diff --git a/content/mappings.js b/content/mappings.js
index 388282dc..044d373a 100644
--- a/content/mappings.js
+++ b/content/mappings.js
@@ -215,6 +215,7 @@ vimperator.Mappings = function () //{{{
add: function (map)
{
+ // a map can have multiple names (see default-map sections, there are many multiples)
for (var i = 0; i < map.names.length; i++)
{
// only store keysyms with uppercase modifier strings
@@ -223,6 +224,7 @@ vimperator.Mappings = function () //{{{
removeMap(map.modes[j], map.names[i]);
}
+ // all maps got removed (matching names = lhs), and added newly here
for (var k = 0; k < map.modes.length; k++)
user[map.modes[k]].push(map);
},
@@ -274,7 +276,9 @@ vimperator.Mappings = function () //{{{
list: function (modes, filter)
{
- var maps = user[modes[0]]; // duplicate (reference)
+ // 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 output = [];
if (!maps || maps.length == 0)
@@ -286,15 +290,15 @@ vimperator.Mappings = function () //{{{
for (var i = 0; i < maps.length; i++) // check on maps items (first mode)
{
output.push(true);
- if (filter && maps[i].names[0] != filter) // XXX: may compare