From 83808b2a136f1506d8f04ef84b9cae0e7ca4f3fe Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 16 Aug 2009 01:44:20 +1000 Subject: [PATCH] Fix mode indicators in :map output. --- common/content/mappings.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/common/content/mappings.js b/common/content/mappings.js index a29ee581..f1905540 100755 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -526,16 +526,13 @@ function Mappings() //{{{ list: function (modes, filter) { let modeSign = ""; - modes.forEach(function (mode) - { - if (mode == modes.NORMAL) - modeSign += "n"; - if ((mode == modes.INSERT || mode == modes.TEXTAREA) && modeSign.indexOf("i") == -1) - modeSign += "i"; - if (mode == modes.COMMAND_LINE) - modeSign += "c"; - if (mode == modes.MESSAGRE) - modeSign += "m"; + + // TODO: Vim hides "nv" in a :map and "v" and "n" in :vmap and + // :nmap respectively if the map is not exclusive. + modes.forEach(function (mode) { + for (let m in modules.modes.mainModes) + if (mode == m.mask && modeSign.indexOf(m.char) == -1) + modeSign += m.char; }); let maps = mappingsIterator(modes, user);