emacs: fix handling of universalArgument, it sets data.count to 4
This commit is contained in:
parent
c084a8a34a
commit
ab2021bdd8
1 changed files with 17 additions and 8 deletions
|
|
@ -231,6 +231,10 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
|||
if (count) {
|
||||
data.count = count;
|
||||
return {command: "null"};
|
||||
} else if (data.universalArgument) {
|
||||
// if no number pressed use emacs defaults for universalArgument
|
||||
// which is 4
|
||||
data.count = 4;
|
||||
}
|
||||
}
|
||||
data.universalArgument = false;
|
||||
|
|
@ -288,15 +292,20 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
|||
if (data.count) {
|
||||
var count = data.count;
|
||||
data.count = 0;
|
||||
return {
|
||||
args: args,
|
||||
command: {
|
||||
exec: function(editor, args) {
|
||||
for (var i = 0; i < count; i++)
|
||||
command.exec(editor, args);
|
||||
if (!command || !command.handlesCount) {
|
||||
return {
|
||||
args: args,
|
||||
command: {
|
||||
exec: function(editor, args) {
|
||||
for (var i = 0; i < count; i++)
|
||||
command.exec(editor, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
} else {
|
||||
if (!args) args = {}
|
||||
if (typeof args === 'object') args.count = count;
|
||||
}
|
||||
}
|
||||
|
||||
return {command: command, args: args};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue