We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efce335 commit ca95a84Copy full SHA for ca95a84
2 files changed
lib/repl.js
@@ -721,11 +721,11 @@ REPLServer.prototype.complete = function(line, callback) {
721
722
// REPL commands (e.g. ".break").
723
var match = null;
724
- match = line.match(/^\s*(\.\w*)$/);
+ match = line.match(/^\s*\.(\w*)$/);
725
if (match) {
726
completionGroups.push(Object.keys(this.commands));
727
completeOn = match[1];
728
- if (match[1].length > 1) {
+ if (match[1].length) {
729
filter = match[1];
730
}
731
test/parallel/test-repl-tab-complete.js
@@ -260,3 +260,10 @@ putIn.run(['.clear']);
260
testMe.complete('var log = console.lo', common.mustCall((error, data) => {
261
assert.deepStrictEqual(data, [['console.log'], 'console.lo']);
262
}));
263
+
264
+// tab completion for defined commands
265
+putIn.run(['.clear']);
266
267
+testMe.complete('.b', common.mustCall((error, data) => {
268
+ assert.deepStrictEqual(data, [['break'], 'b']);
269
+}));
0 commit comments