From 74310ca17a17da72a6d4549d4ef1dac6ee6008db Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Wed, 9 Jan 2008 16:44:40 +0000 Subject: [PATCH] fixed :noremap which was broken after last commit --- content/events.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/events.js b/content/events.js index 4ce50496..4f8648c6 100644 --- a/content/events.js +++ b/content/events.js @@ -995,6 +995,9 @@ vimperator.Events = function () //{{{ else map = vimperator.mappings.get(vimperator.mode, candidateCommand); + var isUniqueMapping = vimperator.mappings.getCandidates(vimperator.mode, candidateCommand).filter( + function(candidate) { return !candidate.noremap; }).length == 1; + // counts must be at the start of a complete mapping (10j -> go 10 lines down) if (/^[1-9][0-9]*$/.test(vimperator.input.buffer + key)) { @@ -1020,10 +1023,9 @@ vimperator.Events = function () //{{{ tmp.execute(null, vimperator.input.count, key); } - } // only follow a map if there isn't a longer possible mapping (allows you to do :map yy, when y is a mapping) - else if (map && !skipMap && vimperator.mappings.getCandidates(vimperator.mode, candidateCommand).length == 1) + else if (map && isUniqueMapping && !skipMap) { vimperator.input.count = parseInt(countStr, 10); if (isNaN(vimperator.input.count))