mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 11:27:58 +01:00
fixed :map <Right> gt
This commit is contained in:
@@ -1022,8 +1022,7 @@ vimperator.Events = function () //{{{
|
|||||||
else
|
else
|
||||||
map = vimperator.mappings.get(vimperator.mode, candidateCommand);
|
map = vimperator.mappings.get(vimperator.mode, candidateCommand);
|
||||||
|
|
||||||
var isUniqueMapping = vimperator.mappings.getCandidates(vimperator.mode, candidateCommand).filter(
|
|
||||||
function(candidate) { return !candidate.noremap; }).length < 2;
|
|
||||||
|
|
||||||
// counts must be at the start of a complete mapping (10j -> go 10 lines down)
|
// 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))
|
if (/^[1-9][0-9]*$/.test(vimperator.input.buffer + key))
|
||||||
@@ -1052,7 +1051,7 @@ vimperator.Events = function () //{{{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// only follow a map if there isn't a longer possible mapping (allows you to do :map yy, when y is a mapping)
|
// 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 && isUniqueMapping && !skipMap)
|
else if (map && !skipMap && vimperator.mappings.getCandidates(vimperator.mode, candidateCommand).length == 0)
|
||||||
{
|
{
|
||||||
vimperator.input.count = parseInt(countStr, 10);
|
vimperator.input.count = parseInt(countStr, 10);
|
||||||
if (isNaN(vimperator.input.count))
|
if (isNaN(vimperator.input.count))
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ vimperator.Mappings = function () //{{{
|
|||||||
return getMap(mode, cmd, main);
|
return getMap(mode, cmd, main);
|
||||||
},
|
},
|
||||||
|
|
||||||
// returns an array of mappings with names which start with "cmd"
|
// returns an array of mappings with names which START with "cmd" (but are NOT "cmd")
|
||||||
getCandidates: function (mode, cmd)
|
getCandidates: function (mode, cmd)
|
||||||
{
|
{
|
||||||
var mappings = user[mode].concat(main[mode]);
|
var mappings = user[mode].concat(main[mode]);
|
||||||
@@ -251,7 +251,7 @@ vimperator.Mappings = function () //{{{
|
|||||||
var map = mappings[i];
|
var map = mappings[i];
|
||||||
for (var j = 0; j < map.names.length; j++)
|
for (var j = 0; j < map.names.length; j++)
|
||||||
{
|
{
|
||||||
if (map.names[j].indexOf(cmd) == 0)
|
if (map.names[j].indexOf(cmd) == 0 && map.names[j].length > cmd.length)
|
||||||
{
|
{
|
||||||
// for < only return a candidate if it doesn't look like a <c-x> mapping
|
// for < only return a candidate if it doesn't look like a <c-x> mapping
|
||||||
if (cmd != "<" || !/^<.+>/.test(map.names[j]))
|
if (cmd != "<" || !/^<.+>/.test(map.names[j]))
|
||||||
|
|||||||
Reference in New Issue
Block a user