mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-04 04:55:06 +03:00
The CommandPanel allows \/
inside of regexes
This commit is contained in:
parent
00832b08bb
commit
395acaf069
@ -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('')); }
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user