diff --git a/src/extensions/command-panel/commands.pegjs b/src/extensions/command-panel/commands.pegjs index 9dde249a7..7536319dc 100644 --- a/src/extensions/command-panel/commands.pegjs +++ b/src/extensions/command-panel/commands.pegjs @@ -59,7 +59,7 @@ selectAllMatchesInProject = 'X' _ 'x' _ '/' pattern:pattern '/'? { return [new SelectAllMatchesInProject(pattern)] } pattern - = pattern:[^/]* { return pattern.join('') } + = pattern:('\\/' / [^/])* { return pattern.join('') } integer = digits:[0-9]+ { return parseInt(digits.join('')); } diff --git a/src/extensions/command-panel/spec/command-interpreter-spec.coffee b/src/extensions/command-panel/spec/command-interpreter-spec.coffee index b78079063..f88965815 100644 --- a/src/extensions/command-panel/spec/command-interpreter-spec.coffee +++ b/src/extensions/command-panel/spec/command-interpreter-spec.coffee @@ -172,6 +172,14 @@ describe "CommandInterpreter", -> runs -> expect(interpreter.lastRelativeAddress.subcommands[0].regex.toString()).toEqual "/a\\Sray/i" + it "allows the regex to contain an escaped forward slash", -> + buffer.setText "hey/baby" + + waitsForPromise -> + interpreter.eval('/y\\/b/', editSession) + runs -> + expect(editSession.getSelectedText()).toBe "y/b" + describe "when no match is found", -> it "it returns an error messages", -> errorMessages = null