Browse Source

add $ to variable name character matching patterns in repl completer

v0.7.4-release
Sean Coates 14 years ago
committed by Ryan Dahl
parent
commit
ae87007478
  1. 4
      lib/repl.js

4
lib/repl.js

@ -266,8 +266,8 @@ REPLServer.prototype.complete = function (line) {
// spam.eggs.<|> # completions for 'spam.eggs' with filter ''
// foo<|> # all scope vars with filter 'foo'
// foo.<|> # completions for 'foo' with filter ''
else if (line.length === 0 || line[line.length-1].match(/\w|\./)) {
var simpleExpressionPat = /(([a-zA-Z_]\w*)\.)*([a-zA-Z_]\w*)\.?$/;
else if (line.length === 0 || line[line.length-1].match(/\w|\.|\$/)) {
var simpleExpressionPat = /(([a-zA-Z_$](?:\w|\$)*)\.)*([a-zA-Z_$](?:\w|\$)*)\.?$/;
match = simpleExpressionPat.exec(line);
if (line.length === 0 || match) {
var expr;

Loading…
Cancel
Save