mirror of https://github.com/nodejs/node.git
repl: fix space autocompletion bug
Tapping <SP> + <TAB> would exit the REPL.pull/24503/head
parent
18240193ba
commit
415bff26fe
|
@ -589,6 +589,8 @@ REPLServer.prototype.complete = function(line, callback) {
|
|||
} else {
|
||||
completionGroupsLoaded();
|
||||
}
|
||||
} else {
|
||||
completionGroupsLoaded();
|
||||
}
|
||||
|
||||
// Will be called when all completionGroups are in place
|
||||
|
|
|
@ -190,3 +190,15 @@ putIn.run([
|
|||
testMe.complete('str.len', function(error, data) {
|
||||
assert.deepEqual(data, [['str.length'], 'str.len']);
|
||||
});
|
||||
|
||||
putIn.run(['.clear']);
|
||||
|
||||
// tab completion should not break on spaces
|
||||
var spaceTimeout = setTimeout(function() {
|
||||
throw new Error('timeout');
|
||||
}, 1000);
|
||||
|
||||
testMe.complete(' ', function(error, data) {
|
||||
assert.deepEqual(data, [[],undefined]);
|
||||
clearTimeout(spaceTimeout);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue