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) {
|
if (count) {
|
||||||
data.count = count;
|
data.count = count;
|
||||||
return {command: "null"};
|
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;
|
data.universalArgument = false;
|
||||||
|
|
@ -288,15 +292,20 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
||||||
if (data.count) {
|
if (data.count) {
|
||||||
var count = data.count;
|
var count = data.count;
|
||||||
data.count = 0;
|
data.count = 0;
|
||||||
return {
|
if (!command || !command.handlesCount) {
|
||||||
args: args,
|
return {
|
||||||
command: {
|
args: args,
|
||||||
exec: function(editor, args) {
|
command: {
|
||||||
for (var i = 0; i < count; i++)
|
exec: function(editor, args) {
|
||||||
command.exec(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};
|
return {command: command, args: args};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue