1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 14:18:00 +01:00

fixed :noremap which was broken after last commit

This commit is contained in:
Martin Stubenschrott
2008-01-09 16:44:40 +00:00
parent ab60334b01
commit 74310ca17a

View File

@@ -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))