emacs: allow count prefixes bigger than 9
example: C-1 C-8 C-f to move 18 chars forward
This commit is contained in:
parent
a16380eaea
commit
b11e88885d
1 changed files with 3 additions and 2 deletions
|
|
@ -236,9 +236,10 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
|||
|
||||
// CTRL + number / universalArgument for setting data.count
|
||||
if (modifier == "c-" || data.universalArgument) {
|
||||
var prevCount = String(data.count || 0);
|
||||
var count = parseInt(key[key.length - 1]);
|
||||
if (count) {
|
||||
data.count = count;
|
||||
if (typeof count === 'number' && !isNaN(count)) {
|
||||
data.count = parseInt(prevCount + count);
|
||||
return {command: "null"};
|
||||
} else if (data.universalArgument) {
|
||||
// if no number pressed use emacs defaults for universalArgument
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue